mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
implement setting vsync and swapinterval
vsync is not "true" vsync (that's always on in browsers) but changes the main loop timer from immediate to window.requestAnimationFrame
This commit is contained in:
parent
2d3fc1a384
commit
b75f4b4f67
@ -173,8 +173,7 @@ int main(int argc, char *argv[])
|
||||
emscripten_set_canvas_element_size("#canvas", 800, 600);
|
||||
emscripten_set_element_css_size("#canvas", 800.0, 600.0);
|
||||
rarch_main(argc, argv, NULL);
|
||||
emscripten_set_main_loop(emscripten_mainloop,
|
||||
settings->bools.video_vsync ? 0 : INT_MAX, 1);
|
||||
emscripten_set_main_loop(emscripten_mainloop, 0, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -51,8 +51,11 @@ static int emscripten_initial_height;
|
||||
static void gfx_ctx_emscripten_swap_interval(void *data, unsigned interval)
|
||||
{
|
||||
(void)data;
|
||||
/* no way to control VSync in WebGL. */
|
||||
(void)interval;
|
||||
|
||||
if (interval == 0)
|
||||
emscripten_set_main_loop_timing(EM_TIMING_SETIMMEDIATE, 0);
|
||||
else
|
||||
emscripten_set_main_loop_timing(EM_TIMING_RAF, (int)interval);
|
||||
}
|
||||
|
||||
static void gfx_ctx_emscripten_get_canvas_size(int *width, int *height)
|
||||
|
Loading…
x
Reference in New Issue
Block a user