From 1d016e6ff5123c06a40c93adb1a5c4df3f697948 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 7 Nov 2014 21:34:22 -0600 Subject: [PATCH] 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. --- code/sdl/sdl_glimp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index 1f12fb72..df201686 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -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;