GPUDrawCall.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. class "GPUDrawCall"
  2. function GPUDrawCall:__getvar(name)
  3. if name == "mesh" then
  4. local retVal = Polycore.GPUDrawCall_get_mesh(self.__ptr)
  5. if retVal == nil then return nil end
  6. local __c = _G["Mesh"]("__skip_ptr__")
  7. __c.__ptr = retVal
  8. return __c
  9. elseif name == "options" then
  10. local retVal = Polycore.GPUDrawCall_get_options(self.__ptr)
  11. if retVal == nil then return nil end
  12. local __c = _G["GPUDrawOptions"]("__skip_ptr__")
  13. __c.__ptr = retVal
  14. return __c
  15. elseif name == "modelMatrix" then
  16. local retVal = Polycore.GPUDrawCall_get_modelMatrix(self.__ptr)
  17. if retVal == nil then return nil end
  18. local __c = _G["Matrix4"]("__skip_ptr__")
  19. __c.__ptr = retVal
  20. return __c
  21. elseif name == "material" then
  22. local retVal = Polycore.GPUDrawCall_get_material(self.__ptr)
  23. if retVal == nil then return nil end
  24. local __c = _G["Material"]("__skip_ptr__")
  25. __c.__ptr = retVal
  26. return __c
  27. end
  28. end
  29. function GPUDrawCall:__setvar(name,value)
  30. if name == "options" then
  31. Polycore.GPUDrawCall_set_options(self.__ptr, value.__ptr)
  32. return true
  33. elseif name == "modelMatrix" then
  34. Polycore.GPUDrawCall_set_modelMatrix(self.__ptr, value.__ptr)
  35. return true
  36. end
  37. return false
  38. end
  39. function GPUDrawCall:__delete()
  40. if self then Polycore.delete_GPUDrawCall(self.__ptr) end
  41. end