SceneRenderTexture.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. function SceneRenderTexture() {
  2. Object.defineProperties(this, {
  3. 'enabled': { enumerable: true, configurable: true, get: SceneRenderTexture.prototype.__get_enabled, set: SceneRenderTexture.prototype.__set_enabled}
  4. })
  5. }
  6. SceneRenderTexture.prototype.__get_enabled = function() {
  7. return Polycode.SceneRenderTexture__get_enabled(this.__ptr)
  8. }
  9. SceneRenderTexture.prototype.__set_enabled = function(val) {
  10. Polycode.SceneRenderTexture__set_enabled(this.__ptr, val)
  11. }
  12. Duktape.fin(SceneRenderTexture.prototype, function (x) {
  13. if (x === SceneRenderTexture.prototype) {
  14. return;
  15. }
  16. Polycode.SceneRenderTexture__delete(x.__ptr)
  17. })
  18. SceneRenderTexture.prototype.getTargetTexture = function() {
  19. var retVal = new Texture()
  20. retVal.__ptr = Polycode.SceneRenderTexture_getTargetTexture(this.__ptr)
  21. return retVal
  22. }
  23. SceneRenderTexture.prototype.getFilterColorBufferTexture = function() {
  24. var retVal = new Texture()
  25. retVal.__ptr = Polycode.SceneRenderTexture_getFilterColorBufferTexture(this.__ptr)
  26. return retVal
  27. }
  28. SceneRenderTexture.prototype.getFilterZBufferTexture = function() {
  29. var retVal = new Texture()
  30. retVal.__ptr = Polycode.SceneRenderTexture_getFilterZBufferTexture(this.__ptr)
  31. return retVal
  32. }
  33. SceneRenderTexture.prototype.Render = function() {
  34. Polycode.SceneRenderTexture_Render(this.__ptr)
  35. }
  36. SceneRenderTexture.prototype.saveToImage = function() {
  37. var retVal = new Image()
  38. retVal.__ptr = Polycode.SceneRenderTexture_saveToImage(this.__ptr)
  39. return retVal
  40. }
  41. SceneRenderTexture.prototype.resizeRenderTexture = function(newWidth,newHeight) {
  42. Polycode.SceneRenderTexture_resizeRenderTexture(this.__ptr, newWidth,newHeight)
  43. }
  44. SceneRenderTexture.prototype.getTargetScene = function() {
  45. var retVal = new Scene()
  46. retVal.__ptr = Polycode.SceneRenderTexture_getTargetScene(this.__ptr)
  47. return retVal
  48. }
  49. SceneRenderTexture.prototype.getTargetCamera = function() {
  50. var retVal = new Camera()
  51. retVal.__ptr = Polycode.SceneRenderTexture_getTargetCamera(this.__ptr)
  52. return retVal
  53. }