Paused main loop still calls requestAnimationFrame

14 views
Skip to first unread message

J Decker

unread,
May 27, 2019, 3:18:55 PM5/27/19
to emscripten-discuss
This GUI library I'm porting has a status of whether it wants to draw continuously, or wants to just notify the system to do a single draw after a change.  (a User form GUI doesn't change that often)

There used to be a function  emscripten_request_animation_frame  But that doesn't seem to exist in headers anymore.... 

So the only way I can seem to get the desired behavior is to use pause_main_loop() and resume_main_loop().  I issue pause_main_loop basically every time a draw happens, but I noticed in profiling that animationloop is still being dispatched, just gets an early return in the emscripten handler I suppose....

I would have gotten rid of the main_loop entirely, and instead just call requestAnimationFrame myself; but like I said there's no request function in current include/emscripten/* headers.

Gabriel Cuvillier

unread,
May 27, 2019, 3:52:29 PM5/27/19
to emscripte...@googlegroups.com

I do have emscripten_request_animation_frame in emscripten/html5.h

I am using sdk-1.38.30-64bit

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/ac8f1293-1ea3-4c7d-9023-b65c6e25770e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

J Decker

unread,
May 27, 2019, 5:46:54 PM5/27/19
to emscripte...@googlegroups.com
On Mon, May 27, 2019 at 12:52 PM Gabriel Cuvillier <gabriel....@gmail.com> wrote:

I do have emscripten_request_animation_frame in emscripten/html5.h

I am using sdk-1.38.30-64bit

H:\dev2\emsdk\emscripten>1.37.40
 I see; I thought I did the update right.
Thank you.
sdk-1.38.32-64bit
Reply all
Reply to author
Forward
0 new messages