SceneRenderTexture.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 Polycore.__ptr_lookup[retVal] ~= nil then
  21. return Polycore.__ptr_lookup[retVal]
  22. else
  23. Polycore.__ptr_lookup[retVal] = Texture("__skip_ptr__")
  24. Polycore.__ptr_lookup[retVal].__ptr = retVal
  25. return Polycore.__ptr_lookup[retVal]
  26. end
  27. end
  28. function SceneRenderTexture:getTargetScene()
  29. local retVal = Polycore.SceneRenderTexture_getTargetScene(self.__ptr)
  30. if Polycore.__ptr_lookup[retVal] ~= nil then
  31. return Polycore.__ptr_lookup[retVal]
  32. else
  33. Polycore.__ptr_lookup[retVal] = Scene("__skip_ptr__")
  34. Polycore.__ptr_lookup[retVal].__ptr = retVal
  35. return Polycore.__ptr_lookup[retVal]
  36. end
  37. end
  38. function SceneRenderTexture:getTargetCamera()
  39. local retVal = Polycore.SceneRenderTexture_getTargetCamera(self.__ptr)
  40. if Polycore.__ptr_lookup[retVal] ~= nil then
  41. return Polycore.__ptr_lookup[retVal]
  42. else
  43. Polycore.__ptr_lookup[retVal] = Camera("__skip_ptr__")
  44. Polycore.__ptr_lookup[retVal].__ptr = retVal
  45. return Polycore.__ptr_lookup[retVal]
  46. end
  47. end
  48. function SceneRenderTexture:__delete()
  49. Polycore.__ptr_lookup[self.__ptr] = nil
  50. Polycore.delete_SceneRenderTexture(self.__ptr)
  51. end