Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions site/source/docs/api_reference/emscripten.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Guide material for the following APIs can be found in :ref:`emscripten-runtime-e
Functions
---------

.. c:function:: void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop)
.. c:function:: void emscripten_set_main_loop(em_callback_func func, int fps, bool simulate_infinite_loop)

Set a C function as the main event loop for the calling thread.

Expand All @@ -373,10 +373,10 @@ Functions

:param em_callback_func func: C function to set as main event loop for the calling thread.
:param int fps: Number of frames per second that the JavaScript will call the function. Setting ``int <=0`` (recommended) uses the browser’s ``requestAnimationFrame`` mechanism to call the function.
:param int simulate_infinite_loop: If true, this function will throw an exception in order to stop execution of the caller.
:param bool simulate_infinite_loop: If true, this function will throw an exception in order to stop execution of the caller.


.. c:function:: void emscripten_set_main_loop_arg(em_arg_callback_func func, void *arg, int fps, int simulate_infinite_loop)
.. c:function:: void emscripten_set_main_loop_arg(em_arg_callback_func func, void *arg, int fps, bool simulate_infinite_loop)

Set a C function as the main event loop for the calling thread, passing it user-defined data.

Expand All @@ -385,7 +385,7 @@ Functions
:param em_arg_callback_func func: C function to set as main event loop. The function signature must have a ``void*`` parameter for passing the ``arg`` value.
:param void* arg: User-defined data passed to the main loop function, untouched by the API itself.
:param int fps: Number of frames per second at which the JavaScript will call the function. Setting ``int <=0`` (recommended) uses the browser’s ``requestAnimationFrame`` mechanism to call the function.
:param int simulate_infinite_loop: If true, this function will throw an exception in order to stop execution of the caller.
:param bool simulate_infinite_loop: If true, this function will throw an exception in order to stop execution of the caller.


.. c:function:: void emscripten_push_main_loop_blocker(em_arg_callback_func func, void *arg)
Expand Down
4 changes: 2 additions & 2 deletions system/include/emscripten/emscripten.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ char *emscripten_run_script_string(const char *script __attribute__((nonnull)));
void emscripten_async_run_script(const char *script __attribute__((nonnull)), int millis);
void emscripten_async_load_script(const char *script __attribute__((nonnull)), em_callback_func onload, em_callback_func onerror);

void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop);
void emscripten_set_main_loop(em_callback_func func, int fps, bool simulate_infinite_loop);

#define EM_TIMING_SETTIMEOUT 0
#define EM_TIMING_RAF 1
#define EM_TIMING_SETIMMEDIATE 2

int emscripten_set_main_loop_timing(int mode, int value);
void emscripten_get_main_loop_timing(int *mode, int *value); // Pass a null pointer to skip receiving that particular value
void emscripten_set_main_loop_arg(em_arg_callback_func func, void *arg, int fps, int simulate_infinite_loop);
void emscripten_set_main_loop_arg(em_arg_callback_func func, void *arg, int fps, bool simulate_infinite_loop);
void emscripten_pause_main_loop(void);
void emscripten_resume_main_loop(void);
void emscripten_cancel_main_loop(void);
Expand Down
Loading