SceneManager.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. class "SceneManager"
  2. function SceneManager:SceneManager(...)
  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.SceneManager(unpack(arg))
  12. Polycore.__ptr_lookup[self.__ptr] = self
  13. end
  14. end
  15. function SceneManager:addScene(newScene)
  16. local retVal = Polycore.SceneManager_addScene(self.__ptr, newScene.__ptr)
  17. end
  18. function SceneManager:Update()
  19. local retVal = Polycore.SceneManager_Update(self.__ptr)
  20. end
  21. function SceneManager:UpdateVirtual()
  22. local retVal = Polycore.SceneManager_UpdateVirtual(self.__ptr)
  23. end
  24. function SceneManager:removeScene(scene)
  25. local retVal = Polycore.SceneManager_removeScene(self.__ptr, scene.__ptr)
  26. end
  27. function SceneManager:registerRenderTexture(r_enderTexture)
  28. local retVal = Polycore.SceneManager_registerRenderTexture(self.__ptr, r_enderTexture.__ptr)
  29. end
  30. function SceneManager:unregisterRenderTexture(r_enderTexture)
  31. local retVal = Polycore.SceneManager_unregisterRenderTexture(self.__ptr, r_enderTexture.__ptr)
  32. end
  33. function SceneManager:__delete()
  34. Polycore.__ptr_lookup[self.__ptr] = nil
  35. Polycore.delete_SceneManager(self.__ptr)
  36. end