RenderBuffer.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. function RenderBuffer() {
  2. Object.defineProperties(this, {
  3. 'colorTexture': { enumerable: true, configurable: true, get: RenderBuffer.prototype.__get_colorTexture, set: RenderBuffer.prototype.__set_colorTexture},
  4. 'depthTexture': { enumerable: true, configurable: true, get: RenderBuffer.prototype.__get_depthTexture, set: RenderBuffer.prototype.__set_depthTexture}
  5. })
  6. }
  7. RenderBuffer.prototype.__get_colorTexture = function() {
  8. var retVal = new Texture()
  9. retVal.__ptr = Polycode.RenderBuffer__get_colorTexture(this.__ptr)
  10. return retVal
  11. }
  12. RenderBuffer.prototype.__set_colorTexture = function(val) {
  13. Polycode.RenderBuffer__set_colorTexture(this.__ptr, val.__ptr)
  14. }
  15. RenderBuffer.prototype.__get_depthTexture = function() {
  16. var retVal = new Texture()
  17. retVal.__ptr = Polycode.RenderBuffer__get_depthTexture(this.__ptr)
  18. return retVal
  19. }
  20. RenderBuffer.prototype.__set_depthTexture = function(val) {
  21. Polycode.RenderBuffer__set_depthTexture(this.__ptr, val.__ptr)
  22. }
  23. Duktape.fin(RenderBuffer.prototype, function (x) {
  24. if (x === RenderBuffer.prototype) {
  25. return;
  26. }
  27. Polycode.RenderBuffer__delete(x.__ptr)
  28. })
  29. RenderBuffer.prototype.getWidth = function() {
  30. return Polycode.RenderBuffer_getWidth(this.__ptr)
  31. }
  32. RenderBuffer.prototype.getHeight = function() {
  33. return Polycode.RenderBuffer_getHeight(this.__ptr)
  34. }