GPUDrawOptions.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. class "GPUDrawOptions"
  2. function GPUDrawOptions:__getvar(name)
  3. if name == "depthTest" then
  4. return Polycode.GPUDrawOptions_get_depthTest(self.__ptr)
  5. elseif name == "depthWrite" then
  6. return Polycode.GPUDrawOptions_get_depthWrite(self.__ptr)
  7. elseif name == "linePointSize" then
  8. return Polycode.GPUDrawOptions_get_linePointSize(self.__ptr)
  9. elseif name == "backfaceCull" then
  10. return Polycode.GPUDrawOptions_get_backfaceCull(self.__ptr)
  11. elseif name == "depthOnly" then
  12. return Polycode.GPUDrawOptions_get_depthOnly(self.__ptr)
  13. elseif name == "forceMaterial" then
  14. return Polycode.GPUDrawOptions_get_forceMaterial(self.__ptr)
  15. elseif name == "blendingMode" then
  16. return Polycode.GPUDrawOptions_get_blendingMode(self.__ptr)
  17. elseif name == "scissorBox" then
  18. local retVal = Polycode.GPUDrawOptions_get_scissorBox(self.__ptr)
  19. if retVal == nil then return nil end
  20. local __c = _G["Rectangle"]("__skip_ptr__")
  21. __c.__ptr = retVal
  22. return __c
  23. elseif name == "enableScissor" then
  24. return Polycode.GPUDrawOptions_get_enableScissor(self.__ptr)
  25. elseif name == "drawColor" then
  26. local retVal = Polycode.GPUDrawOptions_get_drawColor(self.__ptr)
  27. if retVal == nil then return nil end
  28. local __c = _G["Color"]("__skip_ptr__")
  29. __c.__ptr = retVal
  30. return __c
  31. end
  32. end
  33. function GPUDrawOptions:__setvar(name,value)
  34. if name == "depthTest" then
  35. Polycode.GPUDrawOptions_set_depthTest(self.__ptr, value)
  36. return true
  37. elseif name == "depthWrite" then
  38. Polycode.GPUDrawOptions_set_depthWrite(self.__ptr, value)
  39. return true
  40. elseif name == "linePointSize" then
  41. Polycode.GPUDrawOptions_set_linePointSize(self.__ptr, value)
  42. return true
  43. elseif name == "backfaceCull" then
  44. Polycode.GPUDrawOptions_set_backfaceCull(self.__ptr, value)
  45. return true
  46. elseif name == "depthOnly" then
  47. Polycode.GPUDrawOptions_set_depthOnly(self.__ptr, value)
  48. return true
  49. elseif name == "forceMaterial" then
  50. Polycode.GPUDrawOptions_set_forceMaterial(self.__ptr, value)
  51. return true
  52. elseif name == "blendingMode" then
  53. Polycode.GPUDrawOptions_set_blendingMode(self.__ptr, value)
  54. return true
  55. elseif name == "scissorBox" then
  56. Polycode.GPUDrawOptions_set_scissorBox(self.__ptr, value.__ptr)
  57. return true
  58. elseif name == "enableScissor" then
  59. Polycode.GPUDrawOptions_set_enableScissor(self.__ptr, value)
  60. return true
  61. elseif name == "drawColor" then
  62. Polycode.GPUDrawOptions_set_drawColor(self.__ptr, value.__ptr)
  63. return true
  64. end
  65. return false
  66. end
  67. function GPUDrawOptions:__delete()
  68. if self then Polycode.delete_GPUDrawOptions(self.__ptr) end
  69. end