src/SDL_compat.c
changeset 3098 5f372cef955d
parent 3034 0e821769fc51
child 3139 7f684f249ec9
--- a/src/SDL_compat.c	Mon Mar 23 05:35:21 2009 +0000
+++ b/src/SDL_compat.c	Mon Mar 23 05:37:45 2009 +0000
@@ -494,6 +494,15 @@
             return NULL;
         }
     }
+    
+    SDL_GetDesktopDisplayMode(&desktop_mode);
+
+    if (width == 0) {
+        width = desktop_mode.w;
+    }
+    if (height == 0) {
+        height = desktop_mode.h;
+    }
 
     /* See if we can simply resize the existing window and surface */
     if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) {
@@ -567,7 +576,6 @@
     }
 
     /* Set up the desired display mode */
-    SDL_GetDesktopDisplayMode(&desktop_mode);
     desktop_format = desktop_mode.format;
     if (desktop_format && ((flags & SDL_ANYFORMAT)
                            || (bpp == SDL_BITSPERPIXEL(desktop_format)))) {