RenderThread.js 1.6 KB

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