changeset 2862:929e7dd10031

Added current_w and current_h to SDL_VideoInfo for SDL 1.2 compatibility
author Sam Lantinga <slouken@libsdl.org>
date Fri, 12 Dec 2008 06:46:20 +0000
parents 25745ac3d785
children b632927c28c8
files include/SDL_compat.h src/SDL_compat.c test/testvidinfo.c
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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;
 }
--- 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();