Texture.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. require('Polycode/Resource')
  2. function Texture() {
  3. Object.defineProperties(this, {
  4. 'clamp': { enumerable: true, configurable: true, get: Texture.prototype.__get_clamp, set: Texture.prototype.__set_clamp},
  5. 'textureData': { enumerable: true, configurable: true, get: Texture.prototype.__get_textureData, set: Texture.prototype.__set_textureData},
  6. 'type': { enumerable: true, configurable: true, get: Texture.prototype.__get_type, set: Texture.prototype.__set_type},
  7. 'filteringMode': { enumerable: true, configurable: true, get: Texture.prototype.__get_filteringMode, set: Texture.prototype.__set_filteringMode},
  8. 'createMipmaps': { enumerable: true, configurable: true, get: Texture.prototype.__get_createMipmaps, set: Texture.prototype.__set_createMipmaps},
  9. 'anisotropy': { enumerable: true, configurable: true, get: Texture.prototype.__get_anisotropy, set: Texture.prototype.__set_anisotropy},
  10. 'framebufferTexture': { enumerable: true, configurable: true, get: Texture.prototype.__get_framebufferTexture, set: Texture.prototype.__set_framebufferTexture},
  11. 'depthTexture': { enumerable: true, configurable: true, get: Texture.prototype.__get_depthTexture, set: Texture.prototype.__set_depthTexture}
  12. })
  13. }
  14. Texture.prototype = Object.create(Resource.prototype);
  15. Texture.prototype.__get_clamp = function() {
  16. return Polycode.Texture__get_clamp(this.__ptr)
  17. }
  18. Texture.prototype.__set_clamp = function(val) {
  19. Polycode.Texture__set_clamp(this.__ptr, val)
  20. }
  21. Texture.prototype.__get_textureData = function() {
  22. var retVal = new char()
  23. retVal.__ptr = Polycode.Texture__get_textureData(this.__ptr)
  24. return retVal
  25. }
  26. Texture.prototype.__set_textureData = function(val) {
  27. Polycode.Texture__set_textureData(this.__ptr, val.__ptr)
  28. }
  29. Texture.prototype.__get_type = function() {
  30. return Polycode.Texture__get_type(this.__ptr)
  31. }
  32. Texture.prototype.__set_type = function(val) {
  33. Polycode.Texture__set_type(this.__ptr, val)
  34. }
  35. Texture.prototype.__get_filteringMode = function() {
  36. return Polycode.Texture__get_filteringMode(this.__ptr)
  37. }
  38. Texture.prototype.__set_filteringMode = function(val) {
  39. Polycode.Texture__set_filteringMode(this.__ptr, val)
  40. }
  41. Texture.prototype.__get_createMipmaps = function() {
  42. return Polycode.Texture__get_createMipmaps(this.__ptr)
  43. }
  44. Texture.prototype.__set_createMipmaps = function(val) {
  45. Polycode.Texture__set_createMipmaps(this.__ptr, val)
  46. }
  47. Texture.prototype.__get_anisotropy = function() {
  48. return Polycode.Texture__get_anisotropy(this.__ptr)
  49. }
  50. Texture.prototype.__set_anisotropy = function(val) {
  51. Polycode.Texture__set_anisotropy(this.__ptr, val)
  52. }
  53. Texture.prototype.__get_framebufferTexture = function() {
  54. return Polycode.Texture__get_framebufferTexture(this.__ptr)
  55. }
  56. Texture.prototype.__set_framebufferTexture = function(val) {
  57. Polycode.Texture__set_framebufferTexture(this.__ptr, val)
  58. }
  59. Texture.prototype.__get_depthTexture = function() {
  60. return Polycode.Texture__get_depthTexture(this.__ptr)
  61. }
  62. Texture.prototype.__set_depthTexture = function(val) {
  63. Polycode.Texture__set_depthTexture(this.__ptr, val)
  64. }
  65. Texture.prototype.reloadResource = function() {
  66. Polycode.Texture_reloadResource(this.__ptr)
  67. }
  68. Texture.prototype.setImageData = function(data) {
  69. Polycode.Texture_setImageData(this.__ptr, data.__ptr)
  70. }
  71. Texture.prototype.getTextureData = function() {
  72. var retVal = new char()
  73. retVal.__ptr = Polycode.Texture_getTextureData(this.__ptr)
  74. return retVal
  75. }
  76. Texture.prototype.getWidth = function() {
  77. return Polycode.Texture_getWidth(this.__ptr)
  78. }
  79. Texture.prototype.getHeight = function() {
  80. return Polycode.Texture_getHeight(this.__ptr)
  81. }
  82. Texture.prototype.setCreateMipmaps = function(createMipmapsIn) {
  83. Polycode.Texture_setCreateMipmaps(this.__ptr, createMipmapsIn)
  84. }
  85. Texture.prototype.getCreateMipmaps = function() {
  86. return Polycode.Texture_getCreateMipmaps(this.__ptr)
  87. }