Work in progress on OpenGL ReadPixels/WritePixels interface
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Nov 2009 04:58:03 +0000
changeset 3431 c8fbb27627d9
parent 3430 baeff5f3203b
child 3432 116f74112e8a
Work in progress on OpenGL ReadPixels/WritePixels interface
src/video/SDL_renderer_gl.c
--- 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)
 {