Renderer.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. function Renderer() {
  2. }
  3. Renderer.prototype.setGraphicsInterface = function(core,graphicsInterface) {
  4. Polycode.Renderer_setGraphicsInterface(this.__ptr, core,graphicsInterface)
  5. }
  6. Renderer.prototype.getRenderThread = function() {
  7. var retVal = new RenderThread()
  8. retVal.__ptr = Polycode.Renderer_getRenderThread(this.__ptr)
  9. return retVal
  10. }
  11. Renderer.prototype.createCubemap = function(t0,t1,t2,t3,t4,t5) {
  12. var retVal = new Cubemap()
  13. retVal.__ptr = Polycode.Renderer_createCubemap(this.__ptr, t0,t1,t2,t3,t4,t5)
  14. return retVal
  15. }
  16. Renderer.prototype.createTexture = function(width,height,textureData,clamp,createMipmaps,type,filteringMode,anisotropy,framebufferTexture) {
  17. var retVal = new Texture()
  18. retVal.__ptr = Polycode.Renderer_createTexture(this.__ptr, width,height,textureData,clamp,createMipmaps,type,filteringMode,anisotropy,framebufferTexture)
  19. return retVal
  20. }
  21. Renderer.prototype.createRenderBuffer = function(width,height,attachDepthBuffer,floatingPoint) {
  22. var retVal = new RenderBuffer()
  23. retVal.__ptr = Polycode.Renderer_createRenderBuffer(this.__ptr, width,height,attachDepthBuffer,floatingPoint)
  24. return retVal
  25. }
  26. Renderer.prototype.destroyRenderBuffer = function(buffer) {
  27. Polycode.Renderer_destroyRenderBuffer(this.__ptr, buffer)
  28. }
  29. Renderer.prototype.destroyTexture = function(texture) {
  30. Polycode.Renderer_destroyTexture(this.__ptr, texture)
  31. }
  32. Renderer.prototype.processDrawBuffer = function(buffer) {
  33. Polycode.Renderer_processDrawBuffer(this.__ptr, buffer)
  34. }
  35. Renderer.prototype.setBackingResolutionScale = function(xScale,yScale) {
  36. Polycode.Renderer_setBackingResolutionScale(this.__ptr, xScale,yScale)
  37. }
  38. Renderer.prototype.getBackingResolutionScaleX = function() {
  39. return Polycode.Renderer_getBackingResolutionScaleX(this.__ptr)
  40. }
  41. Renderer.prototype.getBackingResolutionScaleY = function() {
  42. return Polycode.Renderer_getBackingResolutionScaleY(this.__ptr)
  43. }
  44. Renderer.prototype.createProgram = function(fileName) {
  45. var retVal = new ShaderProgram()
  46. retVal.__ptr = Polycode.Renderer_createProgram(this.__ptr, fileName)
  47. return retVal
  48. }
  49. Renderer.prototype.createShader = function(vertexProgram,fragmentProgram) {
  50. var retVal = new Shader()
  51. retVal.__ptr = Polycode.Renderer_createShader(this.__ptr, vertexProgram,fragmentProgram)
  52. return retVal
  53. }
  54. Renderer.prototype.createVertexBuffers = function(mesh) {
  55. Polycode.Renderer_createVertexBuffers(this.__ptr, mesh)
  56. }
  57. Renderer.prototype.enqueueFrameJob = function(jobType,data) {
  58. Polycode.Renderer_enqueueFrameJob(this.__ptr, jobType,data)
  59. }
  60. Renderer.prototype.destroyProgram = function(program) {
  61. Polycode.Renderer_destroyProgram(this.__ptr, program)
  62. }
  63. Renderer.prototype.destroyShader = function(shader) {
  64. Polycode.Renderer_destroyShader(this.__ptr, shader)
  65. }
  66. Renderer.prototype.destroyBuffer = function(array) {
  67. Polycode.Renderer_destroyBuffer(this.__ptr, array)
  68. }
  69. Renderer.prototype.destroyShaderBinding = function(binding) {
  70. Polycode.Renderer_destroyShaderBinding(this.__ptr, binding)
  71. }
  72. Renderer.prototype.destroyShaderParam = function(param) {
  73. Polycode.Renderer_destroyShaderParam(this.__ptr, param)
  74. }
  75. Renderer.prototype.setTextureParam = function(param,texture) {
  76. Polycode.Renderer_setTextureParam(this.__ptr, param,texture)
  77. }
  78. Renderer.prototype.setAnisotropyAmount = function(amount) {
  79. Polycode.Renderer_setAnisotropyAmount(this.__ptr, amount)
  80. }
  81. Renderer.prototype.getAnisotropyAmount = function() {
  82. return Polycode.Renderer_getAnisotropyAmount(this.__ptr)
  83. }
  84. Renderer.prototype.createMesh = function(fileName) {
  85. var retVal = new Mesh()
  86. retVal.__ptr = Polycode.Renderer_createMesh(this.__ptr, fileName)
  87. return retVal
  88. }
  89. Renderer.prototype.destroyMesh = function(mesh) {
  90. Polycode.Renderer_destroyMesh(this.__ptr, mesh)
  91. }
  92. Renderer.prototype.beginFrame = function() {
  93. Polycode.Renderer_beginFrame(this.__ptr)
  94. }
  95. Renderer.prototype.endFrame = function() {
  96. Polycode.Renderer_endFrame(this.__ptr)
  97. }