diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-09 17:24:59 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-09 17:24:59 -0700 |
commit | b44981ad9e2e792b31acb5d18ec17685bb8b156b (patch) | |
tree | cfd8e7d4dce154fa35bdb04d63b90f7150097d71 /src | |
parent | 2ce59f770eac07f62814be45daf39ba9b75bad15 (diff) |
call preMainLoop/postMainLoop from glut
Diffstat (limited to 'src')
-rw-r--r-- | src/library_browser.js | 8 | ||||
-rw-r--r-- | src/library_glut.js | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 4ef7c577..6056505d 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -954,9 +954,7 @@ mergeInto(LibraryManager.library, { Browser.mainLoop.method = ''; // just warn once per call to set main loop } - if (Module['preMainLoop']) { - Module['preMainLoop'](); - } + if (Module['preMainLoop']) Module['preMainLoop'](); try { if (typeof arg !== 'undefined') { @@ -973,9 +971,7 @@ mergeInto(LibraryManager.library, { } } - if (Module['postMainLoop']) { - Module['postMainLoop'](); - } + if (Module['postMainLoop']) Module['postMainLoop'](); if (Browser.mainLoop.shouldPause) { // catch pauses from the main loop itself diff --git a/src/library_glut.js b/src/library_glut.js index 445e08a4..3fe6b6a6 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -490,7 +490,9 @@ var LibraryGLUT = { Browser.requestAnimationFrame(function() { GLUT.requestedAnimationFrame = false; if (ABORT) return; + if (Module['preMainLoop']) Module['preMainLoop'](); Runtime.dynCall('v', GLUT.displayFunc); + if (Module['postMainLoop']) Module['postMainLoop'](); }); } }, |