SceneRenderTexture.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. end
  13. end
  14. function SceneRenderTexture:drawScreen()
  15. local retVal = Polycore.SceneRenderTexture_drawScreen(self.__ptr)
  16. end
  17. function SceneRenderTexture:getTargetTexture()
  18. local retVal = Polycore.SceneRenderTexture_getTargetTexture(self.__ptr)
  19. if Polycore.__ptr_lookup[retVal] ~= nil then
  20. return Polycore.__ptr_lookup[retVal]
  21. else
  22. Polycore.__ptr_lookup[retVal] = Texture("__skip_ptr__")
  23. Polycore.__ptr_lookup[retVal].__ptr = retVal
  24. return Polycore.__ptr_lookup[retVal]
  25. end
  26. end
  27. function SceneRenderTexture:getTargetScene()
  28. local retVal = Polycore.SceneRenderTexture_getTargetScene(self.__ptr)
  29. if Polycore.__ptr_lookup[retVal] ~= nil then
  30. return Polycore.__ptr_lookup[retVal]
  31. else
  32. Polycore.__ptr_lookup[retVal] = Scene("__skip_ptr__")
  33. Polycore.__ptr_lookup[retVal].__ptr = retVal
  34. return Polycore.__ptr_lookup[retVal]
  35. end
  36. end
  37. function SceneRenderTexture:getTargetCamera()
  38. local retVal = Polycore.SceneRenderTexture_getTargetCamera(self.__ptr)
  39. if Polycore.__ptr_lookup[retVal] ~= nil then
  40. return Polycore.__ptr_lookup[retVal]
  41. else
  42. Polycore.__ptr_lookup[retVal] = Camera("__skip_ptr__")
  43. Polycore.__ptr_lookup[retVal].__ptr = retVal
  44. return Polycore.__ptr_lookup[retVal]
  45. end
  46. end