src/video/dummy/SDL_nullvideo.c
branchSDL-1.3
changeset 1669 9857d21967bb
parent 1668 4da1ee79c9af
child 1676 e136f3ffdc1b
--- a/src/video/dummy/SDL_nullvideo.c	Mon May 29 04:04:35 2006 +0000
+++ b/src/video/dummy/SDL_nullvideo.c	Mon May 29 05:08:33 2006 +0000
@@ -53,6 +53,8 @@
 static int DUMMY_SetDisplayMode(_THIS, const SDL_DisplayMode * mode);
 static void DUMMY_CreateWindowSurface(_THIS, SDL_Window * window,
                                       Uint32 flags);
+static void DUMMY_UpdateWindowSurface(_THIS, SDL_Window * window,
+                                      int numrects, SDL_Rect * rects);
 static void DUMMY_VideoQuit(_THIS);
 
 /* DUMMY driver bootstrap functions */
@@ -100,6 +102,7 @@
     device->VideoInit = DUMMY_VideoInit;
     device->SetDisplayMode = DUMMY_SetDisplayMode;
     device->CreateWindowSurface = DUMMY_CreateWindowSurface;
+    device->UpdateWindowSurface = DUMMY_UpdateWindowSurface;
     device->VideoQuit = DUMMY_VideoQuit;
     device->InitOSKeymap = DUMMY_InitOSKeymap;
     device->PumpEvents = DUMMY_PumpEvents;
@@ -132,6 +135,7 @@
 static int
 DUMMY_SetDisplayMode(_THIS, const SDL_DisplayMode * mode)
 {
+    SDL_CurrentDisplay.current_mode = *mode;
     return 0;
 }
 
@@ -148,6 +152,19 @@
                              Bmask, Amask);
 }
 
+static void
+DUMMY_UpdateWindowSurface(_THIS, SDL_Window * window, int numrects,
+                          SDL_Rect * rects)
+{
+    static int frame_number;
+    if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) {
+        char file[128];
+        SDL_snprintf(file, sizeof(file), "SDL_screen-%8.8d.bmp",
+                     ++frame_number);
+        SDL_SaveBMP(window->surface, file);
+    }
+}
+
 /* Note:  If we are terminated, this could be called in the middle of
    another SDL video routine -- notably UpdateRects.
 */