changeset 3443:7f477a22dff5

Trying to figure out why the OpenGL tests are failing...
author Sam Lantinga <slouken@libsdl.org>
date Wed, 18 Nov 2009 06:15:44 +0000
parents 204609180482
children 50fca98abc24
files src/video/SDL_glfuncs.h src/video/SDL_renderer_gl.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/SDL_glfuncs.h	Wed Nov 18 06:15:21 2009 +0000
+++ b/src/video/SDL_glfuncs.h	Wed Nov 18 06:15:44 2009 +0000
@@ -314,7 +314,7 @@
 SDL_PROC_UNUSED(void, glRasterPos4s,
                 (GLshort x, GLshort y, GLshort z, GLshort w))
 SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort * v))
-SDL_PROC_UNUSED(void, glReadBuffer, (GLenum mode))
+SDL_PROC(void, glReadBuffer, (GLenum mode))
 SDL_PROC(void, glReadPixels,
          (GLint x, GLint y, GLsizei width, GLsizei height,
           GLenum format, GLenum type, GLvoid * pixels))
--- a/src/video/SDL_renderer_gl.c	Wed Nov 18 06:15:21 2009 +0000
+++ b/src/video/SDL_renderer_gl.c	Wed Nov 18 06:15:44 2009 +0000
@@ -1273,13 +1273,16 @@
     } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
         data->glPixelStorei(GL_PACK_LSB_FIRST, 0);
     }
-    data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
-    data->glPixelStorei(GL_PACK_ROW_LENGTH,
-                        (pitch / bytes_per_pixel(pixel_format)));
+    //data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
+    //data->glPixelStorei(GL_PACK_ROW_LENGTH,
+    //                    (pitch / bytes_per_pixel(pixel_format)));
+    data->glReadBuffer(GL_FRONT);
 
+memset(pixels, 0xff, rect->h*pitch);
     data->glReadPixels(rect->x, rect->y+rect->h-1, rect->w, rect->h,
                        format, type, pixels);
 
+#if 0
     /* Flip the rows to be top-down */
     length = rect->w * bytes_per_pixel(pixel_format);
     src = (Uint8*)pixels + (rect->h-1)*pitch;
@@ -1292,6 +1295,7 @@
         SDL_memcpy(src, tmp, length);
     }
     SDL_stack_free(tmp);
+#endif
 
     return 0;
 }