gl_vidsdl.c: Minor VID_Toggle() fast path optimization.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1026 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
svdijk 2014-09-13 01:48:24 +00:00
parent e3279142e9
commit 775a688c3c
1 changed files with 12 additions and 7 deletions

View File

@ -1406,19 +1406,24 @@ void VID_Init (void)
// new proc by S.A., called by alt-return key binding.
void VID_Toggle (void)
{
// disabling the fast path because with SDL 1.2 it invalidates VBOs (using them
// causes a crash, sugesting that the fullscreen toggle created a new GL context,
// although texture objects remain valid for some reason).
//
// SDL2 does promise window resizes / fullscreen changes preserve the GL context,
// so we could use the fast path with SDL2. --ericw
static qboolean vid_toggle_works = false;
static qboolean vid_toggle_works = true;
qboolean toggleWorked;
S_ClearBuffer ();
if (!vid_toggle_works)
goto vrestart;
else if (gl_vbo_able)
{
// disabling the fast path because with SDL 1.2 it invalidates VBOs (using them
// causes a crash, sugesting that the fullscreen toggle created a new GL context,
// although texture objects remain valid for some reason).
//
// SDL2 does promise window resizes / fullscreen changes preserve the GL context,
// so we could use the fast path with SDL2. --ericw
vid_toggle_works = false;
goto vrestart;
}
#if defined(USE_SDL2)
toggleWorked = SDL_SetWindowFullscreen(draw_context, VID_GetFullscreen() ? 0 : SDL_WINDOW_FULLSCREEN) == 0;