diff src/video/SDL_renderer_gl.c @ 5151:5429daf5e3f9

The DrawRect API is implemented using lines
author Sam Lantinga <slouken@libsdl.org>
date Tue, 01 Feb 2011 20:50:04 -0800
parents ad50b3db78bd
children be02be2ea897
line wrap: on
line diff
--- a/src/video/SDL_renderer_gl.c	Tue Feb 01 19:19:43 2011 -0800
+++ b/src/video/SDL_renderer_gl.c	Tue Feb 01 20:50:04 2011 -0800
@@ -93,8 +93,6 @@
                                const SDL_Point * points, int count);
 static int GL_RenderDrawLines(SDL_Renderer * renderer,
                               const SDL_Point * points, int count);
-static int GL_RenderDrawRects(SDL_Renderer * renderer,
-                              const SDL_Rect ** rects, int count);
 static int GL_RenderFillRects(SDL_Renderer * renderer,
                               const SDL_Rect ** rects, int count);
 static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
@@ -289,7 +287,6 @@
     renderer->RenderClear = GL_RenderClear;
     renderer->RenderDrawPoints = GL_RenderDrawPoints;
     renderer->RenderDrawLines = GL_RenderDrawLines;
-    renderer->RenderDrawRects = GL_RenderDrawRects;
     renderer->RenderFillRects = GL_RenderFillRects;
     renderer->RenderCopy = GL_RenderCopy;
     renderer->RenderReadPixels = GL_RenderReadPixels;
@@ -1139,46 +1136,6 @@
 }
 
 static int
-GL_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
-{
-    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
-    int i, x, y;
-
-    GL_ActivateRenderer(renderer);
-
-    GL_SetBlendMode(data, renderer->blendMode);
-
-    data->glColor4f((GLfloat) renderer->r * inv255f,
-                    (GLfloat) renderer->g * inv255f,
-                    (GLfloat) renderer->b * inv255f,
-                    (GLfloat) renderer->a * inv255f);
-
-    data->glBegin(GL_LINE_LOOP);
-    for (i = 0; i < count; ++i) {
-        const SDL_Rect *rect = rects[i];
-
-        x = rect->x;
-        y = rect->y;
-        data->glVertex2f(0.5f + x, 0.5f + y);
-
-        x = rect->x+rect->w-1;
-        y = rect->y;
-        data->glVertex2f(0.5f + x, 0.5f + y);
-
-        x = rect->x+rect->w-1;
-        y = rect->y+rect->h-1;
-        data->glVertex2f(0.5f + x, 0.5f + y);
-
-        x = rect->x;
-        y = rect->y+rect->h-1;
-        data->glVertex2f(0.5f + x, 0.5f + y);
-    }
-    data->glEnd();
-
-    return 0;
-}
-
-static int
 GL_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
 {
     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;