GPUDrawOptions.lua 2.7 KB

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