diff src/video/SDL_video.c @ 1677:5e4c5e095925 SDL-1.3

Added new style dummy renderer
author Sam Lantinga <slouken@libsdl.org>
date Tue, 13 Jun 2006 04:37:45 +0000
parents e136f3ffdc1b
children 90bf530ced8e
line wrap: on
line diff
--- a/src/video/SDL_video.c	Mon Jun 12 09:10:06 2006 +0000
+++ b/src/video/SDL_video.c	Tue Jun 13 04:37:45 2006 +0000
@@ -307,7 +307,7 @@
     return _this;
 }
 
-void
+int
 SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode)
 {
     SDL_VideoDisplay display;
@@ -318,22 +318,26 @@
     }
     display.current_mode = display.desktop_mode;
 
-    SDL_AddVideoDisplay(&display);
+    return SDL_AddVideoDisplay(&display);
 }
 
-void
+int
 SDL_AddVideoDisplay(const SDL_VideoDisplay * display)
 {
     SDL_VideoDisplay *displays;
+    int index = -1;
 
     displays =
         SDL_realloc(_this->displays,
                     (_this->num_displays + 1) * sizeof(*displays));
     if (displays) {
-        displays[_this->num_displays] = *display;
+        index = _this->num_displays++;
+        displays[index] = *display;
         _this->displays = displays;
-        _this->num_displays++;
+    } else {
+        SDL_OutOfMemory();
     }
+    return index;
 }
 
 int