diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 13:28:40 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 13:28:40 -0700 |
commit | 50d59708df29324c9c913310b49db93241ca1e48 (patch) | |
tree | 28a26b68120f0bd783b8d3d3e68835d807cb5113 /system/include/emscripten.h | |
parent | 34a0667d67e4f4679b438277212a446c3d3f3996 (diff) |
use requestAnimationFrame
Diffstat (limited to 'system/include/emscripten.h')
-rw-r--r-- | system/include/emscripten.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/system/include/emscripten.h b/system/include/emscripten.h index fa95645a..4725e68a 100644 --- a/system/include/emscripten.h +++ b/system/include/emscripten.h @@ -22,8 +22,8 @@ extern void emscripten_async_run_script(const char *script, int millis); /* * Set a C function as the main event loop. The JS environment * will call that function at a specified number of frames per - * second. Setting 0 as the fps will use the default browser - * frame rate. + * second. Setting 0 or a negative value as the fps will use + * the browser's requestAnimationFrame mechanism. */ extern void emscripten_set_main_loop(void (*func)(), int fps); extern void emscripten_cancel_main_loop(); @@ -33,6 +33,9 @@ extern void emscripten_cancel_main_loop(); * control to the JS event loop. This is done by a setTimeout. * When building natively this becomes a simple direct call, * after SDL_Delay (you must include SDL.h for that). + * + * If millis is negative, the browser's requestAnimationFrame + * mechanism is used. */ #if EMSCRIPTEN extern void emscripten_async_call(void (*func)(), int millis); |