RenderThread.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_DESTROY_TEXTURE = 8
  8. RenderThread.JOB_DESTROY_SHADER = 9
  9. RenderThread.JOB_DESTROY_PROGRAM = 10
  10. RenderThread.JOB_DESTROY_SUBMESH_BUFFER = 11
  11. RenderThread.JOB_DESTROY_RENDER_BUFFER = 13
  12. RenderThread.JOB_SET_TEXTURE_PARAM = 14
  13. Duktape.fin(RenderThread.prototype, function (x) {
  14. if (x === RenderThread.prototype) {
  15. return;
  16. }
  17. Polycode.RenderThread__delete(x.__ptr)
  18. })
  19. RenderThread.prototype.runThread = function() {
  20. Polycode.RenderThread_runThread(this.__ptr)
  21. }
  22. RenderThread.prototype.beginFrame = function() {
  23. Polycode.RenderThread_beginFrame(this.__ptr)
  24. }
  25. RenderThread.prototype.endFrame = function() {
  26. Polycode.RenderThread_endFrame(this.__ptr)
  27. }
  28. RenderThread.prototype.updateRenderThread = function() {
  29. Polycode.RenderThread_updateRenderThread(this.__ptr)
  30. }
  31. RenderThread.prototype.processJob = function(job) {
  32. Polycode.RenderThread_processJob(this.__ptr, job)
  33. }
  34. RenderThread.prototype.clearFrameQueue = function() {
  35. Polycode.RenderThread_clearFrameQueue(this.__ptr)
  36. }
  37. RenderThread.prototype.getFrameInfo = function() {
  38. var retVal = new RenderThreadDebugInfo("__skip_ptr__")
  39. retVal.__ptr = Polycode.RenderThread_getFrameInfo(this.__ptr)
  40. return retVal
  41. }
  42. RenderThread.prototype.initGlobals = function() {
  43. Polycode.RenderThread_initGlobals(this.__ptr)
  44. }
  45. RenderThread.prototype.lockRenderMutex = function() {
  46. Polycode.RenderThread_lockRenderMutex(this.__ptr)
  47. }
  48. RenderThread.prototype.unlockRenderMutex = function() {
  49. Polycode.RenderThread_unlockRenderMutex(this.__ptr)
  50. }