OpenGLGraphicsInterface.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. function OpenGLGraphicsInterface() {
  2. }
  3. OpenGLGraphicsInterface.prototype.createTexture = function(texture) {
  4. Polycode.OpenGLGraphicsInterface_createTexture(this.__ptr, texture)
  5. }
  6. OpenGLGraphicsInterface.prototype.destroyTexture = function(texture) {
  7. Polycode.OpenGLGraphicsInterface_destroyTexture(this.__ptr, texture)
  8. }
  9. OpenGLGraphicsInterface.prototype.setViewport = function(x,y,width,height) {
  10. Polycode.OpenGLGraphicsInterface_setViewport(this.__ptr, x,y,width,height)
  11. }
  12. OpenGLGraphicsInterface.prototype.clearBuffers = function(clearColor,colorBuffer,depthBuffer,stencilBuffer) {
  13. Polycode.OpenGLGraphicsInterface_clearBuffers(this.__ptr, clearColor,colorBuffer,depthBuffer,stencilBuffer)
  14. }
  15. OpenGLGraphicsInterface.prototype.setParamInShader = function(shader,param,localParam) {
  16. Polycode.OpenGLGraphicsInterface_setParamInShader(this.__ptr, shader,param,localParam)
  17. }
  18. OpenGLGraphicsInterface.prototype.setAttributeInShader = function(shader,attribute,attributeBinding) {
  19. Polycode.OpenGLGraphicsInterface_setAttributeInShader(this.__ptr, shader,attribute,attributeBinding)
  20. }
  21. OpenGLGraphicsInterface.prototype.disableAttribute = function(shader,attribute) {
  22. Polycode.OpenGLGraphicsInterface_disableAttribute(this.__ptr, shader,attribute)
  23. }
  24. OpenGLGraphicsInterface.prototype.useShader = function(shader) {
  25. Polycode.OpenGLGraphicsInterface_useShader(this.__ptr, shader)
  26. }
  27. OpenGLGraphicsInterface.prototype.createProgram = function(program) {
  28. Polycode.OpenGLGraphicsInterface_createProgram(this.__ptr, program)
  29. }
  30. OpenGLGraphicsInterface.prototype.destroyProgram = function(program) {
  31. Polycode.OpenGLGraphicsInterface_destroyProgram(this.__ptr, program)
  32. }
  33. OpenGLGraphicsInterface.prototype.createVBOForVertexArray = function(array) {
  34. Polycode.OpenGLGraphicsInterface_createVBOForVertexArray(this.__ptr, array)
  35. }
  36. OpenGLGraphicsInterface.prototype.createMesh = function(mesh) {
  37. Polycode.OpenGLGraphicsInterface_createMesh(this.__ptr, mesh)
  38. }
  39. OpenGLGraphicsInterface.prototype.destroyMesh = function(mesh) {
  40. Polycode.OpenGLGraphicsInterface_destroyMesh(this.__ptr, mesh)
  41. }
  42. OpenGLGraphicsInterface.prototype.createShader = function(shader) {
  43. Polycode.OpenGLGraphicsInterface_createShader(this.__ptr, shader)
  44. }
  45. OpenGLGraphicsInterface.prototype.destroyShader = function(shader) {
  46. Polycode.OpenGLGraphicsInterface_destroyShader(this.__ptr, shader)
  47. }
  48. OpenGLGraphicsInterface.prototype.beginDrawCall = function() {
  49. Polycode.OpenGLGraphicsInterface_beginDrawCall(this.__ptr)
  50. }
  51. OpenGLGraphicsInterface.prototype.endDrawCall = function() {
  52. Polycode.OpenGLGraphicsInterface_endDrawCall(this.__ptr)
  53. }
  54. OpenGLGraphicsInterface.prototype.setBlendingMode = function(blendingMode) {
  55. Polycode.OpenGLGraphicsInterface_setBlendingMode(this.__ptr, blendingMode)
  56. }
  57. OpenGLGraphicsInterface.prototype.createRenderBuffer = function(renderBuffer) {
  58. Polycode.OpenGLGraphicsInterface_createRenderBuffer(this.__ptr, renderBuffer)
  59. }
  60. OpenGLGraphicsInterface.prototype.destroyRenderBuffer = function(renderBuffer) {
  61. Polycode.OpenGLGraphicsInterface_destroyRenderBuffer(this.__ptr, renderBuffer)
  62. }
  63. OpenGLGraphicsInterface.prototype.bindRenderBuffer = function(renderBuffer) {
  64. Polycode.OpenGLGraphicsInterface_bindRenderBuffer(this.__ptr, renderBuffer)
  65. }
  66. OpenGLGraphicsInterface.prototype.createVertexBuffer = function(dataArray) {
  67. Polycode.OpenGLGraphicsInterface_createVertexBuffer(this.__ptr, dataArray)
  68. }
  69. OpenGLGraphicsInterface.prototype.createIndexBuffer = function(dataArray) {
  70. Polycode.OpenGLGraphicsInterface_createIndexBuffer(this.__ptr, dataArray)
  71. }
  72. OpenGLGraphicsInterface.prototype.destroyBuffer = function(array) {
  73. Polycode.OpenGLGraphicsInterface_destroyBuffer(this.__ptr, array)
  74. }
  75. OpenGLGraphicsInterface.prototype.drawIndices = function(type,indexArray) {
  76. Polycode.OpenGLGraphicsInterface_drawIndices(this.__ptr, type,indexArray)
  77. }
  78. OpenGLGraphicsInterface.prototype.drawArrays = function(type,vertexCount) {
  79. Polycode.OpenGLGraphicsInterface_drawArrays(this.__ptr, type,vertexCount)
  80. }
  81. OpenGLGraphicsInterface.prototype.enableDepthTest = function(val) {
  82. Polycode.OpenGLGraphicsInterface_enableDepthTest(this.__ptr, val)
  83. }
  84. OpenGLGraphicsInterface.prototype.enableDepthWrite = function(val) {
  85. Polycode.OpenGLGraphicsInterface_enableDepthWrite(this.__ptr, val)
  86. }
  87. OpenGLGraphicsInterface.prototype.enableBackfaceCulling = function(val) {
  88. Polycode.OpenGLGraphicsInterface_enableBackfaceCulling(this.__ptr, val)
  89. }
  90. OpenGLGraphicsInterface.prototype.setLineSize = function(lineSize) {
  91. Polycode.OpenGLGraphicsInterface_setLineSize(this.__ptr, lineSize)
  92. }
  93. OpenGLGraphicsInterface.prototype.setWireframeMode = function(val) {
  94. Polycode.OpenGLGraphicsInterface_setWireframeMode(this.__ptr, val)
  95. }
  96. OpenGLGraphicsInterface.prototype.enableScissor = function(val) {
  97. Polycode.OpenGLGraphicsInterface_enableScissor(this.__ptr, val)
  98. }
  99. OpenGLGraphicsInterface.prototype.setScissorBox = function(box) {
  100. Polycode.OpenGLGraphicsInterface_setScissorBox(this.__ptr, box)
  101. }