OpenGLCubemap.lua 693 B

12345678910111213141516171819202122232425262728293031323334
  1. require "Polycode/Cubemap"
  2. class "OpenGLCubemap" (Cubemap)
  3. function OpenGLCubemap:OpenGLCubemap(...)
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycore.OpenGLCubemap(unpack(arg))
  13. end
  14. end
  15. function OpenGLCubemap:getTextureID()
  16. local retVal = Polycore.OpenGLCubemap_getTextureID(self.__ptr)
  17. if Polycore.__ptr_lookup[retVal] ~= nil then
  18. return Polycore.__ptr_lookup[retVal]
  19. else
  20. Polycore.__ptr_lookup[retVal] = GLuint("__skip_ptr__")
  21. Polycore.__ptr_lookup[retVal].__ptr = retVal
  22. return Polycore.__ptr_lookup[retVal]
  23. end
  24. end