Material.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. function Material() {
  2. Object.defineProperties(this, {
  3. 'fp16RenderTargets': { enumerable: true, configurable: true, get: Material.prototype.__get_fp16RenderTargets, set: Material.prototype.__set_fp16RenderTargets},
  4. 'shaderModule': { enumerable: true, configurable: true, get: Material.prototype.__get_shaderModule, set: Material.prototype.__set_shaderModule},
  5. 'blendingMode': { enumerable: true, configurable: true, get: Material.prototype.__get_blendingMode, set: Material.prototype.__set_blendingMode},
  6. 'screenMaterial': { enumerable: true, configurable: true, get: Material.prototype.__get_screenMaterial, set: Material.prototype.__set_screenMaterial}
  7. })
  8. }
  9. Material.prototype.__get_fp16RenderTargets = function() {
  10. return Polycode.Material__get_fp16RenderTargets(this.__ptr)
  11. }
  12. Material.prototype.__set_fp16RenderTargets = function(val) {
  13. Polycode.Material__set_fp16RenderTargets(this.__ptr, val)
  14. }
  15. Material.prototype.__get_shaderModule = function() {
  16. var retVal = new void()
  17. retVal.__ptr = Polycode.Material__get_shaderModule(this.__ptr)
  18. return retVal
  19. }
  20. Material.prototype.__set_shaderModule = function(val) {
  21. Polycode.Material__set_shaderModule(this.__ptr, val.__ptr)
  22. }
  23. Material.prototype.__get_blendingMode = function() {
  24. return Polycode.Material__get_blendingMode(this.__ptr)
  25. }
  26. Material.prototype.__set_blendingMode = function(val) {
  27. Polycode.Material__set_blendingMode(this.__ptr, val)
  28. }
  29. Material.prototype.__get_screenMaterial = function() {
  30. return Polycode.Material__get_screenMaterial(this.__ptr)
  31. }
  32. Material.prototype.__set_screenMaterial = function(val) {
  33. Polycode.Material__set_screenMaterial(this.__ptr, val)
  34. }
  35. Material.prototype.addShaderPass = function(pass) {
  36. Polycode.Material_addShaderPass(this.__ptr, pass)
  37. }
  38. Material.prototype.addShaderPassAtIndex = function(pass,shaderIndex) {
  39. Polycode.Material_addShaderPassAtIndex(this.__ptr, pass,shaderIndex)
  40. }
  41. Material.prototype.addShader = function(shader,shaderBinding) {
  42. Polycode.Material_addShader(this.__ptr, shader,shaderBinding)
  43. }
  44. Material.prototype.addShaderAtIndex = function(shader,shaderBinding,shaderIndex) {
  45. Polycode.Material_addShaderAtIndex(this.__ptr, shader,shaderBinding,shaderIndex)
  46. }
  47. Material.prototype.getNumShaderPasses = function() {
  48. return Polycode.Material_getNumShaderPasses(this.__ptr)
  49. }
  50. Material.prototype.removeShaderPass = function(shaderIndex) {
  51. Polycode.Material_removeShaderPass(this.__ptr, shaderIndex)
  52. }
  53. Material.prototype.recreateExpectedShaderParams = function() {
  54. Polycode.Material_recreateExpectedShaderParams(this.__ptr)
  55. }
  56. Material.prototype.addShaderRenderTarget = function(newTarget) {
  57. Polycode.Material_addShaderRenderTarget(this.__ptr, newTarget)
  58. }
  59. Material.prototype.getNumShaderRenderTargets = function() {
  60. return Polycode.Material_getNumShaderRenderTargets(this.__ptr)
  61. }
  62. Material.prototype.getShaderRenderTarget = function(index) {
  63. var retVal = new ShaderRenderTarget()
  64. retVal.__ptr = Polycode.Material_getShaderRenderTarget(this.__ptr, index)
  65. return retVal
  66. }
  67. Material.prototype.removeShaderRenderTarget = function(index) {
  68. Polycode.Material_removeShaderRenderTarget(this.__ptr, index)
  69. }
  70. Material.prototype.recreateRenderTarget = function(renderTarget) {
  71. Polycode.Material_recreateRenderTarget(this.__ptr, renderTarget)
  72. }
  73. Material.prototype.recreateRenderTargets = function() {
  74. Polycode.Material_recreateRenderTargets(this.__ptr)
  75. }
  76. Material.prototype.getName = function() {
  77. return Polycode.Material_getName(this.__ptr)
  78. }
  79. Material.prototype.getShaderPass = function(index) {
  80. var retVal = new ShaderPass()
  81. retVal.__ptr = Polycode.Material_getShaderPass(this.__ptr, index)
  82. return retVal
  83. }
  84. Material.prototype.getShaderBinding = function(index) {
  85. var retVal = new ShaderBinding()
  86. retVal.__ptr = Polycode.Material_getShaderBinding(this.__ptr, index)
  87. return retVal
  88. }
  89. Material.prototype.getShader = function(index) {
  90. var retVal = new Shader()
  91. retVal.__ptr = Polycode.Material_getShader(this.__ptr, index)
  92. return retVal
  93. }
  94. Material.prototype.loadMaterial = function(fileName) {
  95. Polycode.Material_loadMaterial(this.__ptr, fileName)
  96. }
  97. Material.prototype.setName = function(name) {
  98. Polycode.Material_setName(this.__ptr, name)
  99. }
  100. Material.prototype.clearShaders = function() {
  101. Polycode.Material_clearShaders(this.__ptr)
  102. }