Trying to figure out why the OpenGL tests are failing...
authorSam Lantinga
Wed, 18 Nov 2009 06:15:44 +0000
changeset 34437f477a22dff5
parent 3442 204609180482
child 3444 50fca98abc24
Trying to figure out why the OpenGL tests are failing...
src/video/SDL_glfuncs.h
src/video/SDL_renderer_gl.c
     1.1 --- a/src/video/SDL_glfuncs.h	Wed Nov 18 06:15:21 2009 +0000
     1.2 +++ b/src/video/SDL_glfuncs.h	Wed Nov 18 06:15:44 2009 +0000
     1.3 @@ -314,7 +314,7 @@
     1.4  SDL_PROC_UNUSED(void, glRasterPos4s,
     1.5                  (GLshort x, GLshort y, GLshort z, GLshort w))
     1.6  SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort * v))
     1.7 -SDL_PROC_UNUSED(void, glReadBuffer, (GLenum mode))
     1.8 +SDL_PROC(void, glReadBuffer, (GLenum mode))
     1.9  SDL_PROC(void, glReadPixels,
    1.10           (GLint x, GLint y, GLsizei width, GLsizei height,
    1.11            GLenum format, GLenum type, GLvoid * pixels))
     2.1 --- a/src/video/SDL_renderer_gl.c	Wed Nov 18 06:15:21 2009 +0000
     2.2 +++ b/src/video/SDL_renderer_gl.c	Wed Nov 18 06:15:44 2009 +0000
     2.3 @@ -1273,13 +1273,16 @@
     2.4      } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
     2.5          data->glPixelStorei(GL_PACK_LSB_FIRST, 0);
     2.6      }
     2.7 -    data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
     2.8 -    data->glPixelStorei(GL_PACK_ROW_LENGTH,
     2.9 -                        (pitch / bytes_per_pixel(pixel_format)));
    2.10 +    //data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
    2.11 +    //data->glPixelStorei(GL_PACK_ROW_LENGTH,
    2.12 +    //                    (pitch / bytes_per_pixel(pixel_format)));
    2.13 +    data->glReadBuffer(GL_FRONT);
    2.14  
    2.15 +memset(pixels, 0xff, rect->h*pitch);
    2.16      data->glReadPixels(rect->x, rect->y+rect->h-1, rect->w, rect->h,
    2.17                         format, type, pixels);
    2.18  
    2.19 +#if 0
    2.20      /* Flip the rows to be top-down */
    2.21      length = rect->w * bytes_per_pixel(pixel_format);
    2.22      src = (Uint8*)pixels + (rect->h-1)*pitch;
    2.23 @@ -1292,6 +1295,7 @@
    2.24          SDL_memcpy(src, tmp, length);
    2.25      }
    2.26      SDL_stack_free(tmp);
    2.27 +#endif
    2.28  
    2.29      return 0;
    2.30  }