diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-13 10:06:33 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-13 10:06:33 -0700 |
commit | 45ba35aa01f1650ed28479976262236bbf204ef1 (patch) | |
tree | a45ef1240a00776b9fd0b0b9b1a89b877848b474 /src/library_browser.js | |
parent | 3a156a34e83fa301b8abbac6effdb5bd21d9be11 (diff) |
add parameter to emscripten_set_main_loop to optionally simulate an infinite loop by throwing an exception (like glutMainLoop)
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 6985e04a..fc8cb84c 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -402,7 +402,7 @@ mergeInto(LibraryManager.library, { }, millis); }, - emscripten_set_main_loop: function(func, fps) { + emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop) { Module['noExitRuntime'] = true; var jsFunc = FUNCTION_TABLE[func]; @@ -462,6 +462,10 @@ mergeInto(LibraryManager.library, { } } Browser.mainLoop.scheduler(); + + if (simulateInfiniteLoop) { + throw 'emscripten_set_main_loop simulating infinite loop by throwing so we get right into the JS event loop'; + } }, emscripten_cancel_main_loop: function() { |