Clear window buffer when it's created

When starting the game in windowed mode, the window buffer used whatever
was on the screen before running the game. Kind of like you could see
through the window, but it doesn't update what happens behind it.

It makes it look like something is broken or non-responsive.

So clear the window opengl buffer to black.

Credit to theinvsblman for the code.
This commit is contained in:
Zack Middleton 2014-11-07 21:34:22 -06:00
parent 1ad2b413ef
commit 1d016e6ff5

View file

@ -462,6 +462,10 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
continue;
}
qglClearColor( 0, 0, 0, 1 );
qglClear( GL_COLOR_BUFFER_BIT );
SDL_GL_SwapWindow( SDL_window );
SDL_GL_SetSwapInterval( r_swapInterval->integer );
glConfig.colorBits = testColorBits;