mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-01 19:33:38 +00:00
emscripten: Don't fall back to simulating vsync if settings are still pending.
Fixes #16146. Closes #16151.
This commit is contained in:
@@ -67,6 +67,12 @@ bool Emscripten_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval)
|
||||
|
||||
bool Emscripten_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval)
|
||||
{
|
||||
const int pending = Emscripten_GetPendingSwapInterval();
|
||||
if (pending >= 0) {
|
||||
*interval = pending;
|
||||
return true; // we're planning to set it to this once the system settles down.
|
||||
}
|
||||
|
||||
int mode, value;
|
||||
|
||||
emscripten_get_main_loop_timing(&mode, &value);
|
||||
|
||||
@@ -438,6 +438,11 @@ bool Emscripten_ShouldSetSwapInterval(int interval)
|
||||
return true;
|
||||
}
|
||||
|
||||
int Emscripten_GetPendingSwapInterval(void)
|
||||
{
|
||||
return pending_swap_interval;
|
||||
}
|
||||
|
||||
static void Emscripten_PumpEvents(SDL_VideoDevice *_this)
|
||||
{
|
||||
if (!pumpevents_has_run) {
|
||||
|
||||
@@ -57,5 +57,6 @@ struct SDL_WindowData
|
||||
extern SDL_Window *Emscripten_fill_document_window;
|
||||
|
||||
bool Emscripten_ShouldSetSwapInterval(int interval);
|
||||
int Emscripten_GetPendingSwapInterval(void);
|
||||
|
||||
#endif // SDL_emscriptenvideo_h_
|
||||
|
||||
Reference in New Issue
Block a user