diff src/video/SDL_renderer_gl.c @ 3431:c8fbb27627d9

Work in progress on OpenGL ReadPixels/WritePixels interface
author Sam Lantinga <slouken@libsdl.org>
date Sun, 15 Nov 2009 04:58:03 +0000
parents fe2f10481878
children ad845d9835aa
line wrap: on
line diff
--- a/src/video/SDL_renderer_gl.c	Wed Nov 11 06:34:33 2009 +0000
+++ b/src/video/SDL_renderer_gl.c	Sun Nov 15 04:58:03 2009 +0000
@@ -102,7 +102,10 @@
 static int GL_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect);
 static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
                          const SDL_Rect * srcrect, const SDL_Rect * dstrect);
-
+static int GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                               void * pixels, int pitch);
+static int GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                                const void * pixels, int pitch);
 static void GL_RenderPresent(SDL_Renderer * renderer);
 static void GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
 static void GL_DestroyRenderer(SDL_Renderer * renderer);
@@ -312,6 +315,8 @@
     renderer->RenderLine = GL_RenderLine;
     renderer->RenderFill = GL_RenderFill;
     renderer->RenderCopy = GL_RenderCopy;
+    renderer->RenderReadPixels = GL_RenderReadPixels;
+    renderer->RenderWritePixels = GL_RenderWritePixels;
     renderer->RenderPresent = GL_RenderPresent;
     renderer->DestroyTexture = GL_DestroyTexture;
     renderer->DestroyRenderer = GL_DestroyRenderer;
@@ -1235,6 +1240,19 @@
     return 0;
 }
 
+static int
+GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                    void * pixels, int pitch)
+{
+    //glReadPixels(rect->x, rect->y+rect->h-1, rect->w, rect->h,
+}
+
+static int
+GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
+                     const void * pixels, int pitch)
+{
+}
+
 static void
 GL_RenderPresent(SDL_Renderer * renderer)
 {