summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sdl/sdl_input.c18
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