diff options
author | Zack Middleton <zturtleman@gmail.com> | 2015-02-28 18:10:14 -0600 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2015-03-17 11:47:04 +0000 |
commit | 4bb0b58386abc4edc2abd89e671c8fcf9e3d0007 (patch) | |
tree | 69aeb4fdc21ac9f8fa837050ebd173a2011384a8 /src/sdl | |
parent | b05c3941b183db53ae6b1e805a53ef61f255fb6b (diff) |
Don't run vid_restart when "resized" to current size
Diffstat (limited to 'src/sdl')
-rw-r--r-- | src/sdl/sdl_input.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c index 562aef12..9569f3b8 100644 --- a/src/sdl/sdl_input.c +++ b/src/sdl/sdl_input.c @@ -898,11 +898,19 @@ static void IN_ProcessEvents( void ) { case SDL_WINDOWEVENT_RESIZED: { - char width[32], height[32]; - Com_sprintf( width, sizeof( width ), "%d", e.window.data1 ); - Com_sprintf( height, sizeof( height ), "%d", e.window.data2 ); - Cvar_Set( "r_width", width ); - Cvar_Set( "r_height", height ); + int width, height; + + width = e.window.data1; + height = e.window.data2; + + // check if size actually changed + if( cls.glconfig.vidWidth == width && cls.glconfig.vidHeight == height ) + { + break; + } + + Cvar_SetValue( "r_width", width ); + Cvar_SetValue( "r_height", height ); // Wait until user stops dragging for 1 second, so // we aren't constantly recreating the GL context while |