src/render/opengl/SDL_renderer_gl.c
changeset 5157 657543cc92f9
parent 5156 307ccc9c135e
child 5166 4d39eeaad00b
     1.1 --- a/src/render/opengl/SDL_renderer_gl.c	Thu Feb 03 00:19:40 2011 -0800
     1.2 +++ b/src/render/opengl/SDL_renderer_gl.c	Thu Feb 03 00:22:18 2011 -0800
     1.3 @@ -63,8 +63,6 @@
     1.4                           const SDL_Rect * srcrect, const SDL_Rect * dstrect);
     1.5  static int GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
     1.6                                 Uint32 pixel_format, void * pixels, int pitch);
     1.7 -static int GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
     1.8 -                                Uint32 pixel_format, const void * pixels, int pitch);
     1.9  static void GL_RenderPresent(SDL_Renderer * renderer);
    1.10  static void GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
    1.11  static void GL_DestroyRenderer(SDL_Renderer * renderer);
    1.12 @@ -207,7 +205,6 @@
    1.13      renderer->RenderFillRects = GL_RenderFillRects;
    1.14      renderer->RenderCopy = GL_RenderCopy;
    1.15      renderer->RenderReadPixels = GL_RenderReadPixels;
    1.16 -    renderer->RenderWritePixels = GL_RenderWritePixels;
    1.17      renderer->RenderPresent = GL_RenderPresent;
    1.18      renderer->DestroyTexture = GL_DestroyTexture;
    1.19      renderer->DestroyRenderer = GL_DestroyRenderer;
    1.20 @@ -776,50 +773,6 @@
    1.21      return 0;
    1.22  }
    1.23  
    1.24 -static int
    1.25 -GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
    1.26 -                     Uint32 pixel_format, const void * pixels, int pitch)
    1.27 -{
    1.28 -    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
    1.29 -    SDL_Window *window = renderer->window;
    1.30 -    GLint internalFormat;
    1.31 -    GLenum format, type;
    1.32 -    Uint8 *src, *dst, *tmp;
    1.33 -    int w, h, length, rows;
    1.34 -
    1.35 -    GL_ActivateRenderer(renderer);
    1.36 -
    1.37 -    if (!convert_format(data, pixel_format, &internalFormat, &format, &type)) {
    1.38 -        /* FIXME: Do a temp copy to a format that is supported */
    1.39 -        SDL_SetError("Unsupported pixel format");
    1.40 -        return -1;
    1.41 -    }
    1.42 -
    1.43 -    SDL_GetWindowSize(window, &w, &h);
    1.44 -
    1.45 -    data->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    1.46 -    data->glPixelStorei(GL_UNPACK_ROW_LENGTH,
    1.47 -                        (pitch / SDL_BYTESPERPIXEL(pixel_format)));
    1.48 -
    1.49 -    /* Flip the rows to be bottom-up */
    1.50 -    length = rect->h * rect->w * pitch;
    1.51 -    tmp = SDL_stack_alloc(Uint8, length);
    1.52 -    src = (Uint8*)pixels + (rect->h-1)*pitch;
    1.53 -    dst = (Uint8*)tmp;
    1.54 -    rows = rect->h;
    1.55 -    while (rows--) {
    1.56 -        SDL_memcpy(dst, src, pitch);
    1.57 -        dst += pitch;
    1.58 -        src -= pitch;
    1.59 -    }
    1.60 -
    1.61 -    data->glRasterPos2i(rect->x, (h-rect->y));
    1.62 -    data->glDrawPixels(rect->w, rect->h, format, type, tmp);
    1.63 -    SDL_stack_free(tmp);
    1.64 -
    1.65 -    return 0;
    1.66 -}
    1.67 -
    1.68  static void
    1.69  GL_RenderPresent(SDL_Renderer * renderer)
    1.70  {