Mercurial > sdl-ios-xcode
diff src/video/SDL_renderer_gles.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_gles.c Tue Feb 01 19:19:43 2011 -0800 +++ b/src/video/SDL_renderer_gles.c Tue Feb 01 20:50:04 2011 -0800 @@ -81,8 +81,6 @@ const SDL_Point * points, int count); static int GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, int count); -static int GLES_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count); static int GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count); static int GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, @@ -229,7 +227,6 @@ renderer->DirtyTexture = GLES_DirtyTexture; renderer->RenderDrawPoints = GLES_RenderDrawPoints; renderer->RenderDrawLines = GLES_RenderDrawLines; - renderer->RenderDrawRects = GLES_RenderDrawRects; renderer->RenderFillRects = GLES_RenderFillRects; renderer->RenderCopy = GLES_RenderCopy; renderer->RenderPresent = GLES_RenderPresent; @@ -668,45 +665,6 @@ } static int -GLES_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, - int count) -{ - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; - int i; - - GLES_ActivateRenderer(renderer); - - GLES_SetBlendMode(data, renderer->blendMode); - - data->glColor4f((GLfloat) renderer->r * inv255f, - (GLfloat) renderer->g * inv255f, - (GLfloat) renderer->b * inv255f, - (GLfloat) renderer->a * inv255f); - - for (i = 0; i < count; ++i) { - const SDL_Rect *rect = rects[i]; - GLshort minx = rect->x; - GLshort maxx = rect->x + rect->w; - GLshort miny = rect->y; - GLshort maxy = rect->y + rect->h; - GLshort vertices[8]; - vertices[0] = minx; - vertices[1] = miny; - vertices[2] = maxx; - vertices[3] = miny; - vertices[4] = minx; - vertices[5] = maxy; - vertices[6] = maxx; - vertices[7] = maxy; - - data->glVertexPointer(2, GL_SHORT, 0, vertices); - data->glDrawArrays(GL_LINE_LOOP, 0, 4); - } - - return 0; -} - -static int GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) {