GPUDrawCall.lua 1.2 KB

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