diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-12 17:19:21 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-12 17:19:21 -0700 |
commit | e141881ad1b43a1cf5ab9a570b52f11ce5befc62 (patch) | |
tree | 195882f36be1c59082c7a49757d7ca0869f2a7f7 /src/webGLWorker.js | |
parent | 68e6cd231b58ae8fe2a921ba43675317ecfd84b0 (diff) |
throttle proxied frames
Diffstat (limited to 'src/webGLWorker.js')
-rw-r--r-- | src/webGLWorker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 37b844b6..4ccc8d55 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -609,7 +609,10 @@ function WebGLWorker() { Module['postMainLoop'] = function() { if (postMainLoop) postMainLoop(); // frame complete, send the command buffer - postMessage({ target: 'gl', op: 'render', commandBuffer: commandBuffer }); + if (Math.abs(frameId - clientFrameId) <= 3) { + // only send if not throttling + postMessage({ target: 'gl', op: 'render', commandBuffer: commandBuffer }); + } commandBuffer = []; }; } |