diff src/video/x11/SDL_x11modes.c @ 1545:8d9bb0cf2c2a

Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set. SDL_SetVideoMode() now accepts 0 for width or height and will use the current video mode (or the desktop mode if no mode has been set.)
author Sam Lantinga <slouken@libsdl.org>
date Wed, 15 Mar 2006 17:46:41 +0000
parents d910939febfa
children 3ba88cb7eb1b
line wrap: on
line diff
--- a/src/video/x11/SDL_x11modes.c	Wed Mar 15 15:47:49 2006 +0000
+++ b/src/video/x11/SDL_x11modes.c	Wed Mar 15 17:46:41 2006 +0000
@@ -652,21 +652,21 @@
     if ( currently_fullscreen ) {
         /* Switch resolution and cover it with the FSwindow */
         move_cursor_to(this, x, y);
-        set_best_resolution(this, current_w, current_h);
+        set_best_resolution(this, window_w, window_h);
         move_cursor_to(this, x, y);
         get_real_resolution(this, &real_w, &real_h);
-        if ( current_w > real_w ) {
+        if ( window_w > real_w ) {
             real_w = MAX(real_w, screen_w);
         }
-        if ( current_h > real_h ) {
+        if ( window_h > real_h ) {
             real_h = MAX(real_h, screen_h);
         }
         pXMoveResizeWindow(SDL_Display, FSwindow, x, y, real_w, real_h);
         move_cursor_to(this, real_w/2, real_h/2);
 
         /* Center and reparent the drawing window */
-        x = (real_w - current_w)/2;
-        y = (real_h - current_h)/2;
+        x = (real_w - window_w)/2;
+        y = (real_h - window_h)/2;
         pXReparentWindow(SDL_Display, SDL_Window, FSwindow, x, y);
         /* FIXME: move the mouse to the old relative location */
         pXSync(SDL_Display, True);   /* Flush spurious mode change events */
@@ -706,10 +706,10 @@
     screen_w = DisplayWidth(SDL_Display, SDL_Screen);
     screen_h = DisplayHeight(SDL_Display, SDL_Screen);
     get_real_resolution(this, &real_w, &real_h);
-    if ( current_w > real_w ) {
+    if ( window_w > real_w ) {
         real_w = MAX(real_w, screen_w);
     }
-    if ( current_h > real_h ) {
+    if ( window_h > real_h ) {
         real_h = MAX(real_h, screen_h);
     }
     pXMoveResizeWindow(SDL_Display, FSwindow,