From e162c6334e08d3b6a9c4097b4014e7b3c922d0ff Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 7 Nov 2014 21:34:22 -0600 Subject: 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. --- src/sdl/sdl_glimp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sdl/sdl_glimp.c') diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index a88d9173..69cdb374 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -477,6 +477,10 @@ static int GLimp_SetMode( qboolean failSafe, qboolean fullscreen, qboolean nobor 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; -- cgit