mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +00:00
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:
parent
e3279142e9
commit
775a688c3c
1 changed files with 12 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue