RenderThread.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. function RenderThread() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.RenderThread()
  4. }
  5. }
  6. RenderThread.JOB_REQUEST_CONTEXT_CHANGE = 0
  7. RenderThread.JOB_PROCESS_DRAW_BUFFER = 2
  8. RenderThread.JOB_END_FRAME = 3
  9. RenderThread.JOB_BEGIN_FRAME = 6
  10. RenderThread.JOB_DESTROY_TEXTURE = 8
  11. RenderThread.JOB_DESTROY_SHADER = 9
  12. RenderThread.JOB_DESTROY_PROGRAM = 10
  13. RenderThread.JOB_DESTROY_SUBMESH_BUFFER = 11
  14. RenderThread.JOB_DESTROY_RENDER_BUFFER = 13
  15. RenderThread.JOB_SET_TEXTURE_PARAM = 14
  16. Duktape.fin(RenderThread.prototype, function (x) {
  17. if (x === RenderThread.prototype) {
  18. return;
  19. }
  20. Polycode.RenderThread__delete(x.__ptr)
  21. })
  22. RenderThread.prototype.setGraphicsInterface = function(core,graphicsInterface) {
  23. Polycode.RenderThread_setGraphicsInterface(this.__ptr, core.__ptr, graphicsInterface.__ptr)
  24. }
  25. RenderThread.prototype.runThread = function() {
  26. Polycode.RenderThread_runThread(this.__ptr)
  27. }
  28. RenderThread.prototype.updateRenderThread = function() {
  29. Polycode.RenderThread_updateRenderThread(this.__ptr)
  30. }
  31. RenderThread.prototype.enqueueFrame = function(frame) {
  32. Polycode.RenderThread_enqueueFrame(this.__ptr, frame.__ptr)
  33. }
  34. RenderThread.prototype.enqueueJob = function(jobType,data,data2) {
  35. Polycode.RenderThread_enqueueJob(this.__ptr, jobType, data.__ptr, data2.__ptr)
  36. }
  37. RenderThread.prototype.processJob = function(job) {
  38. Polycode.RenderThread_processJob(this.__ptr, job)
  39. }
  40. RenderThread.prototype.clearFrameQueue = function() {
  41. Polycode.RenderThread_clearFrameQueue(this.__ptr)
  42. }
  43. RenderThread.prototype.getShaderBinding = function() {
  44. var retVal = new ShaderBinding()
  45. retVal.__ptr = Polycode.RenderThread_getShaderBinding(this.__ptr)
  46. return retVal
  47. }
  48. RenderThread.prototype.processDrawBufferLights = function(buffer) {
  49. Polycode.RenderThread_processDrawBufferLights(this.__ptr, buffer.__ptr)
  50. }
  51. RenderThread.prototype.processDrawBuffer = function(buffer) {
  52. Polycode.RenderThread_processDrawBuffer(this.__ptr, buffer.__ptr)
  53. }
  54. RenderThread.prototype.getFrameInfo = function() {
  55. var retVal = new RenderThreadDebugInfo()
  56. retVal.__ptr = Polycode.RenderThread_getFrameInfo(this.__ptr)
  57. return retVal
  58. }
  59. RenderThread.prototype.initGlobals = function() {
  60. Polycode.RenderThread_initGlobals(this.__ptr)
  61. }
  62. RenderThread.prototype.lockRenderMutex = function() {
  63. Polycode.RenderThread_lockRenderMutex(this.__ptr)
  64. }
  65. RenderThread.prototype.unlockRenderMutex = function() {
  66. Polycode.RenderThread_unlockRenderMutex(this.__ptr)
  67. }