comparison src/video/gapi/SDL_gapivideo.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 21b1fbb53f4a
children 782fd950bd46 c121d94672cb aa07730d792f
comparison
equal deleted inserted replaced
1544:ab1e4c41ab71 1545:8d9bb0cf2c2a
527 /* set up normal and landscape mode */ 527 /* set up normal and landscape mode */
528 GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth); 528 GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth);
529 GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight); 529 GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight);
530 } 530 }
531 531
532 /* Determine the current screen size */
533 this->info.current_w = gapi->gxProperties.cxWidth;
534 this->info.current_h = gapi->gxProperties.cyHeight;
535
532 /* Sort the mode lists */ 536 /* Sort the mode lists */
533 for ( i=0; i<NUM_MODELISTS; ++i ) { 537 for ( i=0; i<NUM_MODELISTS; ++i ) {
534 if ( gapi->SDL_nummodes[i] > 0 ) { 538 if ( gapi->SDL_nummodes[i] > 0 ) {
535 SDL_qsort(gapi->SDL_modelist[i], gapi->SDL_nummodes[i], sizeof *gapi->SDL_modelist[i], cmpmodes); 539 SDL_qsort(gapi->SDL_modelist[i], gapi->SDL_nummodes[i], sizeof *gapi->SDL_modelist[i], cmpmodes);
536 } 540 }