SceneRenderTexture.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 shared_ptr<Texture>()
  20. retVal.__ptr = Polycode.SceneRenderTexture_getTargetTexture(this.__ptr)
  21. return retVal
  22. }
  23. SceneRenderTexture.prototype.Render = function() {
  24. Polycode.SceneRenderTexture_Render(this.__ptr)
  25. }
  26. SceneRenderTexture.prototype.saveToImage = function() {
  27. var retVal = new Image()
  28. retVal.__ptr = Polycode.SceneRenderTexture_saveToImage(this.__ptr)
  29. return retVal
  30. }
  31. SceneRenderTexture.prototype.resizeRenderTexture = function(newWidth,newHeight) {
  32. Polycode.SceneRenderTexture_resizeRenderTexture(this.__ptr, newWidth,newHeight)
  33. }
  34. SceneRenderTexture.prototype.getTargetScene = function() {
  35. var retVal = new Scene()
  36. retVal.__ptr = Polycode.SceneRenderTexture_getTargetScene(this.__ptr)
  37. return retVal
  38. }
  39. SceneRenderTexture.prototype.getTargetCamera = function() {
  40. var retVal = new Camera()
  41. retVal.__ptr = Polycode.SceneRenderTexture_getTargetCamera(this.__ptr)
  42. return retVal
  43. }