CoreServices.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. require "Polycode/EventDispatcher"
  2. class "CoreServices" (EventDispatcher)
  3. function CoreServices.getInstance()
  4. local retVal = Polycore.CoreServices_getInstance()
  5. if retVal == nil then return nil end
  6. local __c = _G["CoreServices"]("__skip_ptr__")
  7. __c.__ptr = retVal
  8. return __c
  9. end
  10. function CoreServices.setInstance(_instance)
  11. local retVal = Polycore.CoreServices_setInstance(_instance.__ptr)
  12. end
  13. function CoreServices.getRenderMutex()
  14. local retVal = Polycore.CoreServices_getRenderMutex()
  15. if retVal == nil then return nil end
  16. local __c = _G["CoreMutex"]("__skip_ptr__")
  17. __c.__ptr = retVal
  18. return __c
  19. end
  20. function CoreServices.createInstance()
  21. local retVal = Polycore.CoreServices_createInstance()
  22. end
  23. function CoreServices:setRenderer(r_enderer)
  24. local retVal = Polycore.CoreServices_setRenderer(self.__ptr, r_enderer.__ptr)
  25. end
  26. function CoreServices:getRenderer()
  27. local retVal = Polycore.CoreServices_getRenderer(self.__ptr)
  28. if retVal == nil then return nil end
  29. local __c = _G["Renderer"]("__skip_ptr__")
  30. __c.__ptr = retVal
  31. return __c
  32. end
  33. function CoreServices:Update(elapsed)
  34. local retVal = Polycore.CoreServices_Update(self.__ptr, elapsed)
  35. end
  36. function CoreServices:fixedUpdate()
  37. local retVal = Polycore.CoreServices_fixedUpdate(self.__ptr)
  38. end
  39. function CoreServices:Render(viewport)
  40. local retVal = Polycore.CoreServices_Render(self.__ptr, viewport.__ptr)
  41. end
  42. function CoreServices:setCore(core)
  43. local retVal = Polycore.CoreServices_setCore(self.__ptr, core.__ptr)
  44. end
  45. function CoreServices:getCore()
  46. local retVal = Polycore.CoreServices_getCore(self.__ptr)
  47. if retVal == nil then return nil end
  48. local __c = _G["Core"]("__skip_ptr__")
  49. __c.__ptr = retVal
  50. return __c
  51. end
  52. function CoreServices:getInput()
  53. local retVal = Polycore.CoreServices_getInput(self.__ptr)
  54. if retVal == nil then return nil end
  55. local __c = _G["CoreInput"]("__skip_ptr__")
  56. __c.__ptr = retVal
  57. return __c
  58. end
  59. function CoreServices:getMaterialManager()
  60. local retVal = Polycore.CoreServices_getMaterialManager(self.__ptr)
  61. if retVal == nil then return nil end
  62. local __c = _G["MaterialManager"]("__skip_ptr__")
  63. __c.__ptr = retVal
  64. return __c
  65. end
  66. function CoreServices:getSceneManager()
  67. local retVal = Polycore.CoreServices_getSceneManager(self.__ptr)
  68. if retVal == nil then return nil end
  69. local __c = _G["SceneManager"]("__skip_ptr__")
  70. __c.__ptr = retVal
  71. return __c
  72. end
  73. function CoreServices:getTimerManager()
  74. local retVal = Polycore.CoreServices_getTimerManager(self.__ptr)
  75. if retVal == nil then return nil end
  76. local __c = _G["TimerManager"]("__skip_ptr__")
  77. __c.__ptr = retVal
  78. return __c
  79. end
  80. function CoreServices:getTweenManager()
  81. local retVal = Polycore.CoreServices_getTweenManager(self.__ptr)
  82. if retVal == nil then return nil end
  83. local __c = _G["TweenManager"]("__skip_ptr__")
  84. __c.__ptr = retVal
  85. return __c
  86. end
  87. function CoreServices:getResourceManager()
  88. local retVal = Polycore.CoreServices_getResourceManager(self.__ptr)
  89. if retVal == nil then return nil end
  90. local __c = _G["ResourceManager"]("__skip_ptr__")
  91. __c.__ptr = retVal
  92. return __c
  93. end
  94. function CoreServices:getSoundManager()
  95. local retVal = Polycore.CoreServices_getSoundManager(self.__ptr)
  96. if retVal == nil then return nil end
  97. local __c = _G["SoundManager"]("__skip_ptr__")
  98. __c.__ptr = retVal
  99. return __c
  100. end
  101. function CoreServices:getLogger()
  102. local retVal = Polycore.CoreServices_getLogger(self.__ptr)
  103. if retVal == nil then return nil end
  104. local __c = _G["Logger"]("__skip_ptr__")
  105. __c.__ptr = retVal
  106. return __c
  107. end
  108. function CoreServices:getConfig()
  109. local retVal = Polycore.CoreServices_getConfig(self.__ptr)
  110. if retVal == nil then return nil end
  111. local __c = _G["Config"]("__skip_ptr__")
  112. __c.__ptr = retVal
  113. return __c
  114. end
  115. function CoreServices:__delete()
  116. if self then Polycore.delete_CoreServices(self.__ptr) end
  117. end