SceneRenderTexture.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. class "SceneRenderTexture"
  2. function SceneRenderTexture:SceneRenderTexture(...)
  3. for k,v in pairs(arg) do
  4. if type(v) == "table" then
  5. if v.__ptr ~= nil then
  6. arg[k] = v.__ptr
  7. end
  8. end
  9. end
  10. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  11. self.__ptr = Polycore.SceneRenderTexture(unpack(arg))
  12. Polycore.__ptr_lookup[self.__ptr] = self
  13. end
  14. end
  15. function SceneRenderTexture:drawScreen()
  16. local retVal = Polycore.SceneRenderTexture_drawScreen(self.__ptr)
  17. end
  18. function SceneRenderTexture:getTargetTexture()
  19. local retVal = Polycore.SceneRenderTexture_getTargetTexture(self.__ptr)
  20. if retVal == nil then return nil end
  21. if Polycore.__ptr_lookup[retVal] ~= nil then
  22. return Polycore.__ptr_lookup[retVal]
  23. else
  24. Polycore.__ptr_lookup[retVal] = Texture("__skip_ptr__")
  25. Polycore.__ptr_lookup[retVal].__ptr = retVal
  26. return Polycore.__ptr_lookup[retVal]
  27. end
  28. end
  29. function SceneRenderTexture:getTargetScene()
  30. local retVal = Polycore.SceneRenderTexture_getTargetScene(self.__ptr)
  31. if retVal == nil then return nil end
  32. if Polycore.__ptr_lookup[retVal] ~= nil then
  33. return Polycore.__ptr_lookup[retVal]
  34. else
  35. Polycore.__ptr_lookup[retVal] = Scene("__skip_ptr__")
  36. Polycore.__ptr_lookup[retVal].__ptr = retVal
  37. return Polycore.__ptr_lookup[retVal]
  38. end
  39. end
  40. function SceneRenderTexture:getTargetCamera()
  41. local retVal = Polycore.SceneRenderTexture_getTargetCamera(self.__ptr)
  42. if retVal == nil then return nil end
  43. if Polycore.__ptr_lookup[retVal] ~= nil then
  44. return Polycore.__ptr_lookup[retVal]
  45. else
  46. Polycore.__ptr_lookup[retVal] = Camera("__skip_ptr__")
  47. Polycore.__ptr_lookup[retVal].__ptr = retVal
  48. return Polycore.__ptr_lookup[retVal]
  49. end
  50. end
  51. function SceneRenderTexture:__delete()
  52. Polycore.__ptr_lookup[self.__ptr] = nil
  53. Polycore.delete_SceneRenderTexture(self.__ptr)
  54. end