GPUDrawCall.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. class "GPUDrawCall"
  2. function GPUDrawCall:__getvar(name)
  3. if name == "mesh" then
  4. local retVal = Polycode.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 = Polycode.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 = Polycode.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 = Polycode.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 == "mesh" then
  31. Polycode.GPUDrawCall_set_mesh(self.__ptr, value.__ptr)
  32. return true
  33. elseif name == "options" then
  34. Polycode.GPUDrawCall_set_options(self.__ptr, value.__ptr)
  35. return true
  36. elseif name == "modelMatrix" then
  37. Polycode.GPUDrawCall_set_modelMatrix(self.__ptr, value.__ptr)
  38. return true
  39. elseif name == "material" then
  40. Polycode.GPUDrawCall_set_material(self.__ptr, value.__ptr)
  41. return true
  42. end
  43. return false
  44. end
  45. function GPUDrawCall:__delete()
  46. if self then Polycode.delete_GPUDrawCall(self.__ptr) end
  47. end