# HG changeset patch # User Sam Lantinga # Date 1229064380 0 # Node ID 929e7dd100319c47ebf7fd6623b626a9ad693a0c # Parent 25745ac3d7856001322ffe1c6bff74e0c5691d0d Added current_w and current_h to SDL_VideoInfo for SDL 1.2 compatibility diff -r 25745ac3d785 -r 929e7dd10031 include/SDL_compat.h --- a/include/SDL_compat.h Wed Dec 10 08:39:00 2008 +0000 +++ b/include/SDL_compat.h Fri Dec 12 06:46:20 2008 +0000 @@ -88,6 +88,9 @@ Uint32 video_mem; SDL_PixelFormat *vfmt; + + int current_w; + int current_h; } SDL_VideoInfo; /* The most common video overlay formats. diff -r 25745ac3d785 -r 929e7dd10031 src/SDL_compat.c --- a/src/SDL_compat.c Wed Dec 10 08:39:00 2008 +0000 +++ b/src/SDL_compat.c Fri Dec 12 06:46:20 2008 +0000 @@ -76,6 +76,8 @@ SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); info.vfmt = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask); + info.current_w = mode.w; + info.current_h = mode.h; } return &info; } diff -r 25745ac3d785 -r 929e7dd10031 test/testvidinfo.c --- a/test/testvidinfo.c Wed Dec 10 08:39:00 2008 +0000 +++ b/test/testvidinfo.c Fri Dec 12 06:46:20 2008 +0000 @@ -520,6 +520,7 @@ if (info->blit_fill) { printf("Color fills on hardware surfaces are accelerated\n"); } + printf("Current resolution: %dx%d\n", info->current_w, info->current_h); #if 0 if (argv[1] && (strcmp(argv[1], "-benchmark") == 0)) { RunVideoTests();