diff src/video/SDL_renderer_gl.c @ 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 ad50b3db78bd
line wrap: on
line diff
--- 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);