Texture.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. 'type': { enumerable: true, configurable: true, get: Texture.prototype.__get_type, set: Texture.prototype.__set_type},
  6. 'filteringMode': { enumerable: true, configurable: true, get: Texture.prototype.__get_filteringMode, set: Texture.prototype.__set_filteringMode},
  7. 'createMipmaps': { enumerable: true, configurable: true, get: Texture.prototype.__get_createMipmaps, set: Texture.prototype.__set_createMipmaps},
  8. 'anisotropy': { enumerable: true, configurable: true, get: Texture.prototype.__get_anisotropy, set: Texture.prototype.__set_anisotropy},
  9. 'framebufferTexture': { enumerable: true, configurable: true, get: Texture.prototype.__get_framebufferTexture, set: Texture.prototype.__set_framebufferTexture},
  10. 'depthTexture': { enumerable: true, configurable: true, get: Texture.prototype.__get_depthTexture, set: Texture.prototype.__set_depthTexture}
  11. })
  12. }
  13. Texture.FILTERING_NEAREST = 0
  14. Texture.FILTERING_LINEAR = 1
  15. Texture.prototype = Object.create(Resource.prototype)
  16. Texture.prototype.__get_clamp = function() {
  17. return Polycode.Texture__get_clamp(this.__ptr)
  18. }
  19. Texture.prototype.__set_clamp = function(val) {
  20. Polycode.Texture__set_clamp(this.__ptr, val)
  21. }
  22. Texture.prototype.__get_type = function() {
  23. return Polycode.Texture__get_type(this.__ptr)
  24. }
  25. Texture.prototype.__set_type = function(val) {
  26. Polycode.Texture__set_type(this.__ptr, val)
  27. }
  28. Texture.prototype.__get_filteringMode = function() {
  29. return Polycode.Texture__get_filteringMode(this.__ptr)
  30. }
  31. Texture.prototype.__set_filteringMode = function(val) {
  32. Polycode.Texture__set_filteringMode(this.__ptr, val)
  33. }
  34. Texture.prototype.__get_createMipmaps = function() {
  35. return Polycode.Texture__get_createMipmaps(this.__ptr)
  36. }
  37. Texture.prototype.__set_createMipmaps = function(val) {
  38. Polycode.Texture__set_createMipmaps(this.__ptr, val)
  39. }
  40. Texture.prototype.__get_anisotropy = function() {
  41. return Polycode.Texture__get_anisotropy(this.__ptr)
  42. }
  43. Texture.prototype.__set_anisotropy = function(val) {
  44. Polycode.Texture__set_anisotropy(this.__ptr, val)
  45. }
  46. Texture.prototype.__get_framebufferTexture = function() {
  47. return Polycode.Texture__get_framebufferTexture(this.__ptr)
  48. }
  49. Texture.prototype.__set_framebufferTexture = function(val) {
  50. Polycode.Texture__set_framebufferTexture(this.__ptr, val)
  51. }
  52. Texture.prototype.__get_depthTexture = function() {
  53. return Polycode.Texture__get_depthTexture(this.__ptr)
  54. }
  55. Texture.prototype.__set_depthTexture = function(val) {
  56. Polycode.Texture__set_depthTexture(this.__ptr, val)
  57. }
  58. Texture.prototype.getWidth = function() {
  59. return Polycode.Texture_getWidth(this.__ptr)
  60. }
  61. Texture.prototype.getHeight = function() {
  62. return Polycode.Texture_getHeight(this.__ptr)
  63. }
  64. Texture.prototype.setCreateMipmaps = function(createMipmapsIn) {
  65. Polycode.Texture_setCreateMipmaps(this.__ptr, createMipmapsIn)
  66. }
  67. Texture.prototype.getCreateMipmaps = function() {
  68. return Polycode.Texture_getCreateMipmaps(this.__ptr)
  69. }