changeset 5145:c8e049de174c

Making the API simpler, the renderer present semantics are always having a backbuffer and then discarding it. This is best for hardware accelerated rendering.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 01 Feb 2011 12:19:46 -0800
parents 31e7f523ab3d
children b52793134276
files include/SDL_video.h src/SDL_compat.c src/video/SDL_renderer_gl.c src/video/SDL_renderer_gles.c src/video/SDL_renderer_sw.c src/video/directfb/SDL_DirectFB_render.c src/video/dummy/SDL_nullrender.c src/video/nds/SDL_ndsrender.c src/video/windows/SDL_d3drender.c test/common.c test/testshape.c
diffstat 11 files changed, 80 insertions(+), 294 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_video.h	Mon Jan 31 23:37:30 2011 -0800
+++ b/include/SDL_video.h	Tue Feb 01 12:19:46 2011 -0800
@@ -151,33 +151,12 @@
  */
 typedef enum
 {
-    SDL_RENDERER_SINGLEBUFFER = 0x00000001,     /**< Render directly to the 
-                                                     window, if possible */
-    
-    SDL_RENDERER_PRESENTCOPY = 0x00000002,      /**< Present uses a copy from 
-                                                     back buffer to the front 
-                                                     buffer */
-    
-    SDL_RENDERER_PRESENTFLIP2 = 0x00000004,     /**< Present uses a flip, 
-                                                     swapping back buffer and 
-                                                     front buffer */
-    
-    SDL_RENDERER_PRESENTFLIP3 = 0x00000008,     /**< Present uses a flip, 
-                                                     rotating between two back 
-                                                     buffers and a front buffer
-                                                 */
-    
-    SDL_RENDERER_PRESENTDISCARD = 0x00000010,   /**< Present leaves the contents
-                                                     of the backbuffer undefined
-                                                 */
-    
     SDL_RENDERER_PRESENTVSYNC = 0x00000020,     /**< Present is synchronized 
                                                      with the refresh rate */
     
     SDL_RENDERER_ACCELERATED = 0x00000040       /**< The renderer uses hardware 
                                                      acceleration */
-    
-    } SDL_RendererFlags;
+} SDL_RendererFlags;
 
 /**
  *  \brief Information on the capabilities of a render driver or context.
--- a/src/SDL_compat.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/SDL_compat.c	Tue Feb 01 12:19:46 2011 -0800
@@ -667,9 +667,7 @@
     }
 
     /* Create a renderer for the window */
-    if (SDL_CreateRenderer
-        (SDL_VideoWindow, -1,
-         SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD) < 0) {
+    if (SDL_CreateRenderer(SDL_VideoWindow, -1, 0) < 0) {
         return NULL;
     }
     SDL_GetRendererInfo(&SDL_VideoRendererInfo);
@@ -861,6 +859,7 @@
 SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects)
 {
     int i;
+    SDL_Rect rect;
 
     if (screen == SDL_ShadowSurface) {
         for (i = 0; i < numrects; ++i) {
@@ -887,18 +886,11 @@
                 SDL_UpdateTexture(SDL_VideoTexture, rect, pixels, pitch);
             }
         }
-        if (SDL_VideoRendererInfo.flags & SDL_RENDERER_PRESENTCOPY) {
-            for (i = 0; i < numrects; ++i) {
-                SDL_RenderCopy(SDL_VideoTexture, &rects[i], &rects[i]);
-            }
-        } else {
-            SDL_Rect rect;
-            rect.x = 0;
-            rect.y = 0;
-            rect.w = screen->w;
-            rect.h = screen->h;
-            SDL_RenderCopy(SDL_VideoTexture, &rect, &rect);
-        }
+        rect.x = 0;
+        rect.y = 0;
+        rect.w = screen->w;
+        rect.h = screen->h;
+        SDL_RenderCopy(SDL_VideoTexture, &rect, &rect);
         SDL_RenderPresent();
     }
 }
--- a/src/video/SDL_renderer_gl.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/SDL_renderer_gl.c	Tue Feb 01 12:19:46 2011 -0800
@@ -112,8 +112,7 @@
     GL_CreateRenderer,
     {
      "opengl",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD |
-      SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
+     (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
      15,
      {
       SDL_PIXELFORMAT_INDEX1LSB,
@@ -252,7 +251,6 @@
     SDL_Renderer *renderer;
     GL_RenderData *data;
     GLint value;
-    int doublebuffer;
 
     /* Render directly to the window, unless we're compositing */
 #ifndef __MACOSX__
@@ -304,8 +302,7 @@
     renderer->window = window;
     renderer->driverdata = data;
 
-    renderer->info.flags =
-        (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
+    renderer->info.flags = SDL_RENDERER_ACCELERATED;
 
     if (GL_LoadFunctions(data) < 0) {
         GL_DestroyRenderer(renderer);
@@ -337,12 +334,6 @@
         renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
     }
 
-    if (SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &doublebuffer) == 0) {
-        if (!doublebuffer) {
-            renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
-        }
-    }
-
     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
     renderer->info.max_texture_width = value;
     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
--- a/src/video/SDL_renderer_gles.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/SDL_renderer_gles.c	Tue Feb 01 12:19:46 2011 -0800
@@ -98,8 +98,7 @@
     GLES_CreateRenderer,
     {
      "opengl_es",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD |
-      SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
+     (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
      {
       /* OpenGL ES 1.x supported formats list */
       SDL_PIXELFORMAT_RGBA4444,
@@ -241,8 +240,7 @@
     renderer->window = window;
     renderer->driverdata = data;
 
-    renderer->info.flags =
-        (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
+    renderer->info.flags = SDL_RENDERER_ACCELERATED;
 
 #if defined(__QNXNTO__)
 #if _NTO_VERSION<=641
--- a/src/video/SDL_renderer_sw.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/SDL_renderer_sw.c	Tue Feb 01 12:19:46 2011 -0800
@@ -81,9 +81,7 @@
     SW_CreateRenderer,
     {
      "software",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
-      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
-      SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),
+     (SDL_RENDERER_PRESENTVSYNC),
      14,
      {
       SDL_PIXELFORMAT_INDEX8,
@@ -108,8 +106,7 @@
 {
     Uint32 format;
     SDL_bool updateSize;
-    int current_texture;
-    SDL_Texture *texture[3];
+    SDL_Texture *texture;
     SDL_Surface surface;
     SDL_Renderer *renderer;
     SDL_DirtyRectList dirty;
@@ -150,15 +147,11 @@
 DisplayPaletteChanged(void *userdata, SDL_Palette * palette)
 {
     SW_RenderData *data = (SW_RenderData *) userdata;
-    int i;
 
-    for (i = 0; i < SDL_arraysize(data->texture); ++i) {
-        if (data->texture[i] && data->renderer->SetTexturePalette) {
-            data->renderer->SetTexturePalette(data->renderer,
-                                              data->texture[i],
-                                              palette->colors, 0,
-                                              palette->ncolors);
-        }
+    if (data->renderer->SetTexturePalette) {
+        data->renderer->SetTexturePalette(data->renderer, data->texture,
+                                          palette->colors, 0,
+                                          palette->ncolors);
     }
     return 0;
 }
@@ -237,21 +230,11 @@
     renderer->driverdata = data;
     Setup_SoftwareRenderer(renderer);
 
-    if (flags & SDL_RENDERER_PRESENTFLIP2) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
-        n = 2;
-    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
-        n = 3;
-    } else {
-        renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
-        n = 1;
-    }
+    n = 1;
     data->format = displayMode->format;
 
     /* Find a render driver that we can use to display data */
-    renderer_flags = (SDL_RENDERER_SINGLEBUFFER |
-                      SDL_RENDERER_PRESENTDISCARD);
+    renderer_flags = 0;
     if (flags & SDL_RENDERER_PRESENTVSYNC) {
         renderer_flags |= SDL_RENDERER_PRESENTVSYNC;
     }
@@ -280,15 +263,12 @@
     }
 
     /* Create the textures we'll use for display */
-    for (i = 0; i < n; ++i) {
-        data->texture[i] =
-            CreateTexture(data->renderer, data->format, window->w, window->h);
-        if (!data->texture[i]) {
-            SW_DestroyRenderer(renderer);
-            return NULL;
-        }
+    data->texture =
+        CreateTexture(data->renderer, data->format, window->w, window->h);
+    if (!data->texture) {
+        SW_DestroyRenderer(renderer);
+        return NULL;
     }
-    data->current_texture = 0;
 
     /* Create a surface we'll use for rendering */
     data->surface.flags = SDL_PREALLOC;
@@ -321,26 +301,14 @@
     }
     if (data->updateSize) {
         /* Recreate the textures for the new window size */
-        if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
-            n = 2;
-        } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
-            n = 3;
-        } else {
-            n = 1;
+        if (data->texture) {
+            DestroyTexture(data->renderer, data->texture);
+            data->texture = 0;
         }
-        for (i = 0; i < n; ++i) {
-            if (data->texture[i]) {
-                DestroyTexture(data->renderer, data->texture[i]);
-                data->texture[i] = 0;
-            }
-        }
-        for (i = 0; i < n; ++i) {
-            data->texture[i] =
-                CreateTexture(data->renderer, data->format, window->w,
-                              window->h);
-            if (!data->texture[i]) {
-                return -1;
-            }
+        data->texture = CreateTexture(data->renderer, data->format,
+                                      window->w, window->h);
+        if (!data->texture) {
+            return -1;
         }
         data->updateSize = SDL_FALSE;
     }
@@ -528,7 +496,7 @@
                     int count)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Texture *texture = data->texture[data->current_texture];
+    SDL_Texture *texture = data->texture;
     SDL_Rect rect;
     int i;
     int x, y;
@@ -544,10 +512,6 @@
         return 0;
     }
 
-    if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-        SDL_AddDirtyRect(&data->dirty, &rect);
-    }
-
     if (data->renderer->LockTexture(data->renderer, texture, &rect, 1,
                                     &data->surface.pixels,
                                     &data->surface.pitch) < 0) {
@@ -591,7 +555,7 @@
                    int count)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Texture *texture = data->texture[data->current_texture];
+    SDL_Texture *texture = data->texture;
     SDL_Rect clip, rect;
     int i;
     int x1, y1, x2, y2;
@@ -608,10 +572,6 @@
         return 0;
     }
 
-    if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-        SDL_AddDirtyRect(&data->dirty, &rect);
-    }
-
     if (data->renderer->LockTexture(data->renderer, texture, &rect, 1,
                                     &data->surface.pixels,
                                     &data->surface.pitch) < 0) {
@@ -659,7 +619,7 @@
                    int count)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Texture *texture = data->texture[data->current_texture];
+    SDL_Texture *texture = data->texture;
     SDL_Rect clip, rect;
     Uint32 color = 0;
     int i;
@@ -683,10 +643,6 @@
             continue;
         }
 
-        if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-            SDL_AddDirtyRect(&data->dirty, &rect);
-        }
-
         if (data->renderer->LockTexture(data->renderer, texture, &rect, 1,
                                         &data->surface.pixels,
                                         &data->surface.pitch) < 0) {
@@ -715,7 +671,7 @@
                    int count)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Texture *texture = data->texture[data->current_texture];
+    SDL_Texture *texture = data->texture;
     SDL_Rect clip, rect;
     Uint32 color = 0;
     int i;
@@ -738,10 +694,6 @@
             continue;
         }
 
-        if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-            SDL_AddDirtyRect(&data->dirty, &rect);
-        }
-
         if (data->renderer->LockTexture(data->renderer, texture, &rect, 1,
                                         &data->surface.pixels,
                                         &data->surface.pitch) < 0) {
@@ -772,12 +724,7 @@
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
     int status;
 
-    if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-        SDL_AddDirtyRect(&data->dirty, dstrect);
-    }
-
-    if (data->renderer->LockTexture(data->renderer,
-                                    data->texture[data->current_texture],
+    if (data->renderer->LockTexture(data->renderer, data->texture,
                                     dstrect, 1, &data->surface.pixels,
                                     &data->surface.pitch) < 0) {
         return -1;
@@ -803,8 +750,7 @@
             SDL_LowerBlit(surface, &real_srcrect, &data->surface,
                           &real_dstrect);
     }
-    data->renderer->UnlockTexture(data->renderer,
-                                  data->texture[data->current_texture]);
+    data->renderer->UnlockTexture(data->renderer, data->texture);
     return status;
 }
 
@@ -814,8 +760,7 @@
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
 
-    if (data->renderer->LockTexture(data->renderer,
-                                    data->texture[data->current_texture],
+    if (data->renderer->LockTexture(data->renderer, data->texture,
                                     rect, 0, &data->surface.pixels,
                                     &data->surface.pitch) < 0) {
         return -1;
@@ -825,8 +770,7 @@
                       data->format, data->surface.pixels, data->surface.pitch,
                       format, pixels, pitch);
 
-    data->renderer->UnlockTexture(data->renderer,
-                                  data->texture[data->current_texture]);
+    data->renderer->UnlockTexture(data->renderer, data->texture);
     return 0;
 }
 
@@ -836,12 +780,7 @@
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
 
-    if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-        SDL_AddDirtyRect(&data->dirty, rect);
-    }
-
-    if (data->renderer->LockTexture(data->renderer,
-                                    data->texture[data->current_texture],
+    if (data->renderer->LockTexture(data->renderer, data->texture,
                                     rect, 1, &data->surface.pixels,
                                     &data->surface.pitch) < 0) {
         return -1;
@@ -850,8 +789,7 @@
     SDL_ConvertPixels(rect->w, rect->h, format, pixels, pitch,
                       data->format, data->surface.pixels, data->surface.pitch);
 
-    data->renderer->UnlockTexture(data->renderer,
-                                  data->texture[data->current_texture]);
+    data->renderer->UnlockTexture(data->renderer, data->texture);
     return 0;
 }
 
@@ -859,32 +797,16 @@
 SW_RenderPresent(SDL_Renderer * renderer)
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
-    SDL_Texture *texture = data->texture[data->current_texture];
+    SDL_Texture *texture = data->texture;
+    SDL_Rect rect;
 
     /* Send the data to the display */
-    if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
-        SDL_DirtyRect *dirty;
-        for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
-            data->renderer->RenderCopy(data->renderer, texture, &dirty->rect,
-                                       &dirty->rect);
-        }
-        SDL_ClearDirtyRects(&data->dirty);
-    } else {
-        SDL_Rect rect;
-        rect.x = 0;
-        rect.y = 0;
-        rect.w = texture->w;
-        rect.h = texture->h;
-        data->renderer->RenderCopy(data->renderer, texture, &rect, &rect);
-    }
+    rect.x = 0;
+    rect.y = 0;
+    rect.w = texture->w;
+    rect.h = texture->h;
+    data->renderer->RenderCopy(data->renderer, texture, &rect, &rect);
     data->renderer->RenderPresent(data->renderer);
-
-    /* Update the flipping chain, if any */
-    if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
-        data->current_texture = (data->current_texture + 1) % 2;
-    } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
-        data->current_texture = (data->current_texture + 1) % 3;
-    }
 }
 
 static void
@@ -908,10 +830,8 @@
     int i;
 
     if (data) {
-        for (i = 0; i < SDL_arraysize(data->texture); ++i) {
-            if (data->texture[i]) {
-                DestroyTexture(data->renderer, data->texture[i]);
-            }
+        if (data->texture) {
+            DestroyTexture(data->renderer, data->texture);
         }
         if (data->surface.format) {
             SDL_SetSurfacePalette(&data->surface, NULL);
--- a/src/video/directfb/SDL_DirectFB_render.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/directfb/SDL_DirectFB_render.c	Tue Feb 01 12:19:46 2011 -0800
@@ -87,10 +87,7 @@
     DirectFB_CreateRenderer,
     {
      "directfb",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
-      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
-      SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD |
-      SDL_RENDERER_ACCELERATED),
+     (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
      14,
      {
       SDL_PIXELFORMAT_INDEX4LSB,
@@ -256,7 +253,6 @@
     SDL_VideoDisplay *display = window->display;
     SDL_Renderer *renderer = NULL;
     DirectFB_RenderData *data = NULL;
-    DFBSurfaceCapabilities scaps;
     char *p;
 
     SDL_DFB_CALLOC(renderer, 1, sizeof(*renderer));
@@ -288,8 +284,7 @@
     renderer->window = window;      /* SDL window */
     renderer->driverdata = data;
 
-    renderer->info.flags =
-        SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD;
+    renderer->info.flags = SDL_RENDERER_ACCELERATED;
 
     data->window = window;
 
@@ -301,15 +296,6 @@
     } else
         data->flipflags |= DSFLIP_ONSYNC;
 
-    SDL_DFB_CHECKERR(windata->surface->
-                     GetCapabilities(windata->surface, &scaps));
-    if (scaps & DSCAPS_DOUBLE)
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
-    else if (scaps & DSCAPS_TRIPLE)
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
-    else
-        renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
-
     data->isyuvdirect = 0;      /* default is off! */
     p = SDL_getenv(DFBENV_USE_YUV_DIRECT);
     if (p)
--- a/src/video/dummy/SDL_nullrender.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/dummy/SDL_nullrender.c	Tue Feb 01 12:19:46 2011 -0800
@@ -59,16 +59,13 @@
     SDL_DUMMY_CreateRenderer,
     {
      "dummy",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
-      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
-      SDL_RENDERER_PRESENTDISCARD),
+     (0),
      }
 };
 
 typedef struct
 {
-    int current_screen;
-    SDL_Surface *screens[3];
+    SDL_Surface *screen;
 } SDL_DUMMY_RenderData;
 
 SDL_Renderer *
@@ -78,7 +75,6 @@
     SDL_DisplayMode *displayMode = &display->current_mode;
     SDL_Renderer *renderer;
     SDL_DUMMY_RenderData *data;
-    int i, n;
     int bpp;
     Uint32 Rmask, Gmask, Bmask, Amask;
 
@@ -117,27 +113,14 @@
     renderer->driverdata = data;
     Setup_SoftwareRenderer(renderer);
 
-    if (flags & SDL_RENDERER_PRESENTFLIP2) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
-        n = 2;
-    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
-        renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
-        n = 3;
-    } else {
-        renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
-        n = 1;
+    data->screen =
+        SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask,
+                             Bmask, Amask);
+    if (!data->screen) {
+        SDL_DUMMY_DestroyRenderer(renderer);
+        return NULL;
     }
-    for (i = 0; i < n; ++i) {
-        data->screens[i] =
-            SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask,
-                                 Bmask, Amask);
-        if (!data->screens[i]) {
-            SDL_DUMMY_DestroyRenderer(renderer);
-            return NULL;
-        }
-        SDL_SetSurfacePalette(data->screens[i], display->palette);
-    }
-    data->current_screen = 0;
+    SDL_SetSurfacePalette(data->screen, display->palette);
 
     return renderer;
 }
@@ -148,7 +131,7 @@
 {
     SDL_DUMMY_RenderData *data =
         (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *target = data->screens[data->current_screen];
+    SDL_Surface *target = data->screen;
 
     if (renderer->blendMode == SDL_BLENDMODE_NONE) {
         Uint32 color = SDL_MapRGBA(target->format,
@@ -169,7 +152,7 @@
 {
     SDL_DUMMY_RenderData *data =
         (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *target = data->screens[data->current_screen];
+    SDL_Surface *target = data->screen;
 
     if (renderer->blendMode == SDL_BLENDMODE_NONE) {
         Uint32 color = SDL_MapRGBA(target->format,
@@ -190,7 +173,7 @@
 {
     SDL_DUMMY_RenderData *data =
         (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *target = data->screens[data->current_screen];
+    SDL_Surface *target = data->screen;
 
     if (renderer->blendMode == SDL_BLENDMODE_NONE) {
         Uint32 color = SDL_MapRGBA(target->format,
@@ -212,7 +195,7 @@
 {
     SDL_DUMMY_RenderData *data =
         (SDL_DUMMY_RenderData *) renderer->driverdata;
-    SDL_Surface *target = data->screens[data->current_screen];
+    SDL_Surface *target = data->screen;
 
     if (renderer->blendMode == SDL_BLENDMODE_NONE) {
         Uint32 color = SDL_MapRGBA(target->format,
@@ -238,7 +221,7 @@
     SDL_VideoDisplay *display = window->display;
 
     if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
-        SDL_Surface *target = data->screens[data->current_screen];
+        SDL_Surface *target = data->screen;
         void *pixels =
             (Uint8 *) target->pixels + dstrect->y * target->pitch +
             dstrect->x * target->format->BytesPerPixel;
@@ -248,7 +231,7 @@
                                    target->pitch);
     } else {
         SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
-        SDL_Surface *target = data->screens[data->current_screen];
+        SDL_Surface *target = data->screen;
         SDL_Rect real_srcrect = *srcrect;
         SDL_Rect real_dstrect = *dstrect;
 
@@ -264,7 +247,7 @@
         (SDL_DUMMY_RenderData *) renderer->driverdata;
     SDL_Window *window = renderer->window;
     SDL_VideoDisplay *display = window->display;
-    SDL_Surface *screen = data->screens[data->current_screen];
+    SDL_Surface *screen = data->screen;
     Uint32 screen_format = display->current_mode.format;
     Uint8 *screen_pixels = (Uint8 *) screen->pixels +
                             rect->y * screen->pitch +
@@ -284,7 +267,7 @@
         (SDL_DUMMY_RenderData *) renderer->driverdata;
     SDL_Window *window = renderer->window;
     SDL_VideoDisplay *display = window->display;
-    SDL_Surface *screen = data->screens[data->current_screen];
+    SDL_Surface *screen = data->screen;
     Uint32 screen_format = display->current_mode.format;
     Uint8 *screen_pixels = (Uint8 *) screen->pixels +
                             rect->y * screen->pitch +
@@ -308,14 +291,7 @@
         char file[128];
         SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
                      renderer->window->id, ++frame_number);
-        SDL_SaveBMP(data->screens[data->current_screen], file);
-    }
-
-    /* Update the flipping chain, if any */
-    if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
-        data->current_screen = (data->current_screen + 1) % 2;
-    } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
-        data->current_screen = (data->current_screen + 1) % 3;
+        SDL_SaveBMP(data->screen, file);
     }
 }
 
@@ -327,10 +303,8 @@
     int i;
 
     if (data) {
-        for (i = 0; i < SDL_arraysize(data->screens); ++i) {
-            if (data->screens[i]) {
-                SDL_FreeSurface(data->screens[i]);
-            }
+        if (data->screen) {
+            SDL_FreeSurface(data->screen);
         }
         SDL_free(data);
     }
--- a/src/video/nds/SDL_ndsrender.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/nds/SDL_ndsrender.c	Tue Feb 01 12:19:46 2011 -0800
@@ -71,7 +71,7 @@
 SDL_RenderDriver NDS_RenderDriver = {
     NDS_CreateRenderer,
     {"nds",                     /* char* name */
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),  /* u32 flags */
+     (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC),  /* u32 flags */
      3,                         /* u32 num_texture_formats */
      {
       SDL_PIXELFORMAT_INDEX8,
--- a/src/video/windows/SDL_d3drender.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/src/video/windows/SDL_d3drender.c	Tue Feb 01 12:19:46 2011 -0800
@@ -134,10 +134,7 @@
     D3D_CreateRenderer,
     {
      "d3d",
-     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
-      SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
-      SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC |
-      SDL_RENDERER_ACCELERATED),
+     (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
      0,
      {0},
      0,
@@ -472,19 +469,9 @@
     } else {
         pparams.BackBufferFormat = D3DFMT_UNKNOWN;
     }
-    if (flags & SDL_RENDERER_PRESENTFLIP2) {
-        pparams.BackBufferCount = 2;
-        pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
-    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
-        pparams.BackBufferCount = 3;
-        pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
-    } else if (flags & SDL_RENDERER_PRESENTCOPY) {
-        pparams.BackBufferCount = 1;
-        pparams.SwapEffect = D3DSWAPEFFECT_COPY;
-    } else {
-        pparams.BackBufferCount = 1;
-        pparams.SwapEffect = D3DSWAPEFFECT_DISCARD;
-    }
+    pparams.BackBufferCount = 1;
+    pparams.SwapEffect = D3DSWAPEFFECT_DISCARD;
+
     if (window->flags & SDL_WINDOW_FULLSCREEN) {
         pparams.Windowed = FALSE;
         pparams.FullScreen_RefreshRateInHz =
@@ -534,24 +521,6 @@
         return NULL;
     }
     IDirect3DSwapChain9_Release(chain);
-    switch (pparams.SwapEffect) {
-    case D3DSWAPEFFECT_COPY:
-        renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
-        break;
-    case D3DSWAPEFFECT_FLIP:
-        switch (pparams.BackBufferCount) {
-        case 2:
-            renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
-            break;
-        case 3:
-            renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
-            break;
-        }
-        break;
-    case D3DSWAPEFFECT_DISCARD:
-        renderer->info.flags |= SDL_RENDERER_PRESENTDISCARD;
-        break;
-    }
     if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
         renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
     }
--- a/test/common.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/test/common.c	Tue Feb 01 12:19:46 2011 -0800
@@ -6,7 +6,7 @@
 #include "common.h"
 
 #define VIDEO_USAGE \
-"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display N] [--fullscreen | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--double] [--triple]"
+"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display N] [--fullscreen | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab]"
 
 #define AUDIO_USAGE \
 "[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]"
@@ -211,14 +211,6 @@
         state->render_flags |= SDL_RENDERER_PRESENTVSYNC;
         return 1;
     }
-    if (SDL_strcasecmp(argv[index], "--double") == 0) {
-        state->render_flags |= SDL_RENDERER_PRESENTFLIP2;
-        return 1;
-    }
-    if (SDL_strcasecmp(argv[index], "--triple") == 0) {
-        state->render_flags |= SDL_RENDERER_PRESENTFLIP3;
-        return 1;
-    }
     if (SDL_strcasecmp(argv[index], "--noframe") == 0) {
         state->window_flags |= SDL_WINDOW_BORDERLESS;
         return 1;
@@ -329,21 +321,6 @@
 PrintRendererFlag(Uint32 flag)
 {
     switch (flag) {
-    case SDL_RENDERER_SINGLEBUFFER:
-        fprintf(stderr, "SingleBuffer");
-        break;
-    case SDL_RENDERER_PRESENTCOPY:
-        fprintf(stderr, "PresentCopy");
-        break;
-    case SDL_RENDERER_PRESENTFLIP2:
-        fprintf(stderr, "PresentFlip2");
-        break;
-    case SDL_RENDERER_PRESENTFLIP3:
-        fprintf(stderr, "PresentFlip3");
-        break;
-    case SDL_RENDERER_PRESENTDISCARD:
-        fprintf(stderr, "PresentDiscard");
-        break;
     case SDL_RENDERER_PRESENTVSYNC:
         fprintf(stderr, "PresentVSync");
         break;
--- a/test/testshape.c	Mon Jan 31 23:37:30 2011 -0800
+++ b/test/testshape.c	Tue Feb 01 12:19:46 2011 -0800
@@ -102,7 +102,7 @@
 		printf("Could not create shaped window for SDL_Shape.\n");
 		exit(-4);
 	}
-	if(SDL_CreateRenderer(window,-1,SDL_RENDERER_PRESENTFLIP2) == -1) {
+	if(SDL_CreateRenderer(window,-1,0) == -1) {
 		SDL_DestroyWindow(window);
 		for(i=0;i<num_pictures;i++)
 			SDL_FreeSurface(pictures[i].surface);