comparison src/video/cybergfx/SDL_cgxvideo.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 0a53c90a37f9 c121d94672cb
comparison
equal deleted inserted replaced
1544:ab1e4c41ab71 1545:8d9bb0cf2c2a
461 if ( SDL_Display == NULL ) { 461 if ( SDL_Display == NULL ) {
462 D(bug("Cannot lock display...\n")); 462 D(bug("Cannot lock display...\n"));
463 SDL_SetError("Couldn't lock the display"); 463 SDL_SetError("Couldn't lock the display");
464 return(-1); 464 return(-1);
465 } 465 }
466 this->info.current_w = SDL_Display->Width;
467 this->info.current_h = SDL_Display->Height;
466 468
467 D(bug("Checking if we are using a CGX native display...\n")); 469 D(bug("Checking if we are using a CGX native display...\n"));
468 470
469 if(!IsCyberModeID(GetVPModeID(&SDL_Display->ViewPort))) 471 if(!IsCyberModeID(GetVPModeID(&SDL_Display->ViewPort)))
470 { 472 {
832 if(flags&SDL_HWSURFACE) 834 if(flags&SDL_HWSURFACE)
833 screen->flags|=SDL_HWSURFACE; 835 screen->flags|=SDL_HWSURFACE;
834 836
835 if( !SDL_windowid ) { 837 if( !SDL_windowid ) {
836 CGX_SetSizeHints(this, w, h, flags); 838 CGX_SetSizeHints(this, w, h, flags);
837 current_w = w;
838 current_h = h;
839 } 839 }
840 840
841 /* Set our colormaps when not setting a GL mode */ 841 /* Set our colormaps when not setting a GL mode */
842 /* 842 /*
843 if ( ! (flags & SDL_OPENGL) ) { 843 if ( ! (flags & SDL_OPENGL) ) {
883 D(bug("CGX_ResizeWindow\n")); 883 D(bug("CGX_ResizeWindow\n"));
884 884
885 if ( ! SDL_windowid ) { 885 if ( ! SDL_windowid ) {
886 /* Resize the window manager window */ 886 /* Resize the window manager window */
887 CGX_SetSizeHints(this, w, h, flags); 887 CGX_SetSizeHints(this, w, h, flags);
888 current_w = w;
889 current_h = h;
890 888
891 ChangeWindowBox(SDL_Window,SDL_Window->LeftEdge,SDL_Window->TopEdge, w+SDL_Window->BorderLeft+SDL_Window->BorderRight, 889 ChangeWindowBox(SDL_Window,SDL_Window->LeftEdge,SDL_Window->TopEdge, w+SDL_Window->BorderLeft+SDL_Window->BorderRight,
892 h+SDL_Window->BorderTop+SDL_Window->BorderBottom); 890 h+SDL_Window->BorderTop+SDL_Window->BorderBottom);
893 891
894 screen->w = w; 892 screen->w = w;