Skip to content

Commit

Permalink
Clear window buffer when it's created
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed Nov 8, 2014
1 parent 1ad2b41 commit 1d016e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/sdl/sdl_glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1d016e6

Please sign in to comment.