mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 11:40:52 +00:00
SDL: Support setting vsync at runtime
Allows vid_wait to work under software without having to switch to OpenGL and then back
This commit is contained in:
parent
427944f633
commit
0a98f9c69a
1 changed files with 6 additions and 1 deletions
|
@ -102,7 +102,7 @@ rendermode_t rendermode = render_none;
|
||||||
boolean highcolor = false;
|
boolean highcolor = false;
|
||||||
|
|
||||||
// synchronize page flipping with screen refresh
|
// synchronize page flipping with screen refresh
|
||||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Impl_SetVsync, 0, NULL, NULL, 0, 0, NULL};
|
||||||
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||||
|
@ -2131,4 +2131,9 @@ UINT32 I_GetRefreshRate(void)
|
||||||
return refresh_rate;
|
return refresh_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Impl_SetVsync(void)
|
||||||
|
{
|
||||||
|
#if SDL_VERSION_ATLEAST(2,0,18)
|
||||||
|
if (renderer)
|
||||||
|
SDL_RenderSetVSync(renderer, cv_vidwait.value);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue