2
0

Material.js 3.8 KB

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