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.)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401549
This commit is contained in:
Sam Lantinga 2006-03-15 17:46:41 +00:00
parent 5ab1844363
commit ab022a8987
33 changed files with 140 additions and 37 deletions

View file

@ -400,7 +400,8 @@ int main(int argc, char *argv[])
}
info = SDL_GetVideoInfo();
printf(
"Current display: %d bits-per-pixel\n",info->vfmt->BitsPerPixel);
"Current display: %dx%d, %d bits-per-pixel\n",
info->current_w, info->current_h, info->vfmt->BitsPerPixel);
if ( info->vfmt->palette == NULL ) {
printf(" Red Mask = 0x%.8x\n", info->vfmt->Rmask);
printf(" Green Mask = 0x%.8x\n", info->vfmt->Gmask);