The DrawRect API is implemented using lines
authorSam Lantinga <slouken@libsdl.org>
Tue, 01 Feb 2011 20:50:04 -0800
changeset 51485429daf5e3f9
parent 5147 ad50b3db78bd
child 5149 be02be2ea897
The DrawRect API is implemented using lines
src/video/SDL_renderer_gl.c
src/video/SDL_renderer_gles.c
src/video/SDL_renderer_sw.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/directfb/SDL_DirectFB_render.c
src/video/dummy/SDL_nullrender.c
src/video/windows/SDL_d3drender.c
     1.1 --- a/src/video/SDL_renderer_gl.c	Tue Feb 01 19:19:43 2011 -0800
     1.2 +++ b/src/video/SDL_renderer_gl.c	Tue Feb 01 20:50:04 2011 -0800
     1.3 @@ -93,8 +93,6 @@
     1.4                                 const SDL_Point * points, int count);
     1.5  static int GL_RenderDrawLines(SDL_Renderer * renderer,
     1.6                                const SDL_Point * points, int count);
     1.7 -static int GL_RenderDrawRects(SDL_Renderer * renderer,
     1.8 -                              const SDL_Rect ** rects, int count);
     1.9  static int GL_RenderFillRects(SDL_Renderer * renderer,
    1.10                                const SDL_Rect ** rects, int count);
    1.11  static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    1.12 @@ -289,7 +287,6 @@
    1.13      renderer->RenderClear = GL_RenderClear;
    1.14      renderer->RenderDrawPoints = GL_RenderDrawPoints;
    1.15      renderer->RenderDrawLines = GL_RenderDrawLines;
    1.16 -    renderer->RenderDrawRects = GL_RenderDrawRects;
    1.17      renderer->RenderFillRects = GL_RenderFillRects;
    1.18      renderer->RenderCopy = GL_RenderCopy;
    1.19      renderer->RenderReadPixels = GL_RenderReadPixels;
    1.20 @@ -1139,46 +1136,6 @@
    1.21  }
    1.22  
    1.23  static int
    1.24 -GL_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
    1.25 -{
    1.26 -    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
    1.27 -    int i, x, y;
    1.28 -
    1.29 -    GL_ActivateRenderer(renderer);
    1.30 -
    1.31 -    GL_SetBlendMode(data, renderer->blendMode);
    1.32 -
    1.33 -    data->glColor4f((GLfloat) renderer->r * inv255f,
    1.34 -                    (GLfloat) renderer->g * inv255f,
    1.35 -                    (GLfloat) renderer->b * inv255f,
    1.36 -                    (GLfloat) renderer->a * inv255f);
    1.37 -
    1.38 -    data->glBegin(GL_LINE_LOOP);
    1.39 -    for (i = 0; i < count; ++i) {
    1.40 -        const SDL_Rect *rect = rects[i];
    1.41 -
    1.42 -        x = rect->x;
    1.43 -        y = rect->y;
    1.44 -        data->glVertex2f(0.5f + x, 0.5f + y);
    1.45 -
    1.46 -        x = rect->x+rect->w-1;
    1.47 -        y = rect->y;
    1.48 -        data->glVertex2f(0.5f + x, 0.5f + y);
    1.49 -
    1.50 -        x = rect->x+rect->w-1;
    1.51 -        y = rect->y+rect->h-1;
    1.52 -        data->glVertex2f(0.5f + x, 0.5f + y);
    1.53 -
    1.54 -        x = rect->x;
    1.55 -        y = rect->y+rect->h-1;
    1.56 -        data->glVertex2f(0.5f + x, 0.5f + y);
    1.57 -    }
    1.58 -    data->glEnd();
    1.59 -
    1.60 -    return 0;
    1.61 -}
    1.62 -
    1.63 -static int
    1.64  GL_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
    1.65  {
    1.66      GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
     2.1 --- a/src/video/SDL_renderer_gles.c	Tue Feb 01 19:19:43 2011 -0800
     2.2 +++ b/src/video/SDL_renderer_gles.c	Tue Feb 01 20:50:04 2011 -0800
     2.3 @@ -81,8 +81,6 @@
     2.4                                   const SDL_Point * points, int count);
     2.5  static int GLES_RenderDrawLines(SDL_Renderer * renderer,
     2.6                                  const SDL_Point * points, int count);
     2.7 -static int GLES_RenderDrawRects(SDL_Renderer * renderer,
     2.8 -                                const SDL_Rect ** rects, int count);
     2.9  static int GLES_RenderFillRects(SDL_Renderer * renderer,
    2.10                                  const SDL_Rect ** rects, int count);
    2.11  static int GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    2.12 @@ -229,7 +227,6 @@
    2.13      renderer->DirtyTexture = GLES_DirtyTexture;
    2.14      renderer->RenderDrawPoints = GLES_RenderDrawPoints;
    2.15      renderer->RenderDrawLines = GLES_RenderDrawLines;
    2.16 -    renderer->RenderDrawRects = GLES_RenderDrawRects;
    2.17      renderer->RenderFillRects = GLES_RenderFillRects;
    2.18      renderer->RenderCopy = GLES_RenderCopy;
    2.19      renderer->RenderPresent = GLES_RenderPresent;
    2.20 @@ -668,45 +665,6 @@
    2.21  }
    2.22  
    2.23  static int
    2.24 -GLES_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    2.25 -                     int count)
    2.26 -{
    2.27 -    GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
    2.28 -    int i;
    2.29 -
    2.30 -    GLES_ActivateRenderer(renderer);
    2.31 -
    2.32 -    GLES_SetBlendMode(data, renderer->blendMode);
    2.33 -
    2.34 -    data->glColor4f((GLfloat) renderer->r * inv255f,
    2.35 -                    (GLfloat) renderer->g * inv255f,
    2.36 -                    (GLfloat) renderer->b * inv255f,
    2.37 -                    (GLfloat) renderer->a * inv255f);
    2.38 -
    2.39 -    for (i = 0; i < count; ++i) {
    2.40 -        const SDL_Rect *rect = rects[i];
    2.41 -        GLshort minx = rect->x;
    2.42 -        GLshort maxx = rect->x + rect->w;
    2.43 -        GLshort miny = rect->y;
    2.44 -        GLshort maxy = rect->y + rect->h;
    2.45 -        GLshort vertices[8];
    2.46 -        vertices[0] = minx;
    2.47 -        vertices[1] = miny;
    2.48 -        vertices[2] = maxx;
    2.49 -        vertices[3] = miny;
    2.50 -        vertices[4] = minx;
    2.51 -        vertices[5] = maxy;
    2.52 -        vertices[6] = maxx;
    2.53 -        vertices[7] = maxy;
    2.54 -
    2.55 -        data->glVertexPointer(2, GL_SHORT, 0, vertices);
    2.56 -        data->glDrawArrays(GL_LINE_LOOP, 0, 4);
    2.57 -    }
    2.58 -
    2.59 -    return 0;
    2.60 -}
    2.61 -
    2.62 -static int
    2.63  GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    2.64                       int count)
    2.65  {
     3.1 --- a/src/video/SDL_renderer_sw.c	Tue Feb 01 19:19:43 2011 -0800
     3.2 +++ b/src/video/SDL_renderer_sw.c	Tue Feb 01 20:50:04 2011 -0800
     3.3 @@ -62,8 +62,6 @@
     3.4                                 const SDL_Point * points, int count);
     3.5  static int SW_RenderDrawLines(SDL_Renderer * renderer,
     3.6                                const SDL_Point * points, int count);
     3.7 -static int SW_RenderDrawRects(SDL_Renderer * renderer,
     3.8 -                              const SDL_Rect ** rects, int count);
     3.9  static int SW_RenderFillRects(SDL_Renderer * renderer,
    3.10                                const SDL_Rect ** rects, int count);
    3.11  static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    3.12 @@ -216,7 +214,6 @@
    3.13  
    3.14      renderer->RenderDrawPoints = SW_RenderDrawPoints;
    3.15      renderer->RenderDrawLines = SW_RenderDrawLines;
    3.16 -    renderer->RenderDrawRects = SW_RenderDrawRects;
    3.17      renderer->RenderFillRects = SW_RenderFillRects;
    3.18      renderer->RenderCopy = SW_RenderCopy;
    3.19      renderer->RenderReadPixels = SW_RenderReadPixels;
    3.20 @@ -609,62 +606,6 @@
    3.21  }
    3.22  
    3.23  static int
    3.24 -SW_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    3.25 -                   int count)
    3.26 -{
    3.27 -    SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
    3.28 -    SDL_Texture *texture = SW_ActivateRenderer(renderer);
    3.29 -    SDL_Rect clip, rect;
    3.30 -    Uint32 color = 0;
    3.31 -    int i;
    3.32 -    int status = 0;
    3.33 -
    3.34 -    if (!texture) {
    3.35 -        return -1;
    3.36 -    }
    3.37 -
    3.38 -    clip.x = 0;
    3.39 -    clip.y = 0;
    3.40 -    clip.w = texture->w;
    3.41 -    clip.h = texture->h;
    3.42 -
    3.43 -    if (renderer->blendMode == SDL_BLENDMODE_NONE) {
    3.44 -        color = SDL_MapRGBA(data->surface.format,
    3.45 -                            renderer->r, renderer->g, renderer->b,
    3.46 -                            renderer->a);
    3.47 -    }
    3.48 -
    3.49 -    for (i = 0; i < count; ++i) {
    3.50 -        /* FIXME: We don't want to draw clipped edges */
    3.51 -        if (!SDL_IntersectRect(rects[i], &clip, &rect)) {
    3.52 -            /* Nothing to draw */
    3.53 -            continue;
    3.54 -        }
    3.55 -
    3.56 -        if (data->renderer->LockTexture(data->renderer, texture, &rect, 1,
    3.57 -                                        &data->surface.pixels,
    3.58 -                                        &data->surface.pitch) < 0) {
    3.59 -            return -1;
    3.60 -        }
    3.61 -
    3.62 -        data->surface.clip_rect.w = data->surface.w = rect.w;
    3.63 -        data->surface.clip_rect.h = data->surface.h = rect.h;
    3.64 -
    3.65 -        if (renderer->blendMode == SDL_BLENDMODE_NONE) {
    3.66 -            status = SDL_DrawRect(&data->surface, NULL, color);
    3.67 -        } else {
    3.68 -            status = SDL_BlendRect(&data->surface, NULL,
    3.69 -                                   renderer->blendMode,
    3.70 -                                   renderer->r, renderer->g, renderer->b,
    3.71 -                                   renderer->a);
    3.72 -        }
    3.73 -
    3.74 -        data->renderer->UnlockTexture(data->renderer, texture);
    3.75 -    }
    3.76 -    return status;
    3.77 -}
    3.78 -
    3.79 -static int
    3.80  SW_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    3.81                     int count)
    3.82  {
     4.1 --- a/src/video/SDL_sysvideo.h	Tue Feb 01 19:19:43 2011 -0800
     4.2 +++ b/src/video/SDL_sysvideo.h	Tue Feb 01 20:50:04 2011 -0800
     4.3 @@ -93,8 +93,6 @@
     4.4                               int count);
     4.5      int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
     4.6                              int count);
     4.7 -    int (*RenderDrawRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
     4.8 -                            int count);
     4.9      int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
    4.10                              int count);
    4.11      int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
     5.1 --- a/src/video/SDL_video.c	Tue Feb 01 19:19:43 2011 -0800
     5.2 +++ b/src/video/SDL_video.c	Tue Feb 01 20:50:04 2011 -0800
     5.3 @@ -2319,7 +2319,33 @@
     5.4  int
     5.5  SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect)
     5.6  {
     5.7 -    return SDL_RenderDrawRects(renderer, &rect, 1);
     5.8 +    SDL_Rect full_rect;
     5.9 +    SDL_Point points[5];
    5.10 +
    5.11 +    CHECK_RENDERER_MAGIC(renderer, -1);
    5.12 +
    5.13 +    /* If 'rect' == NULL, then outline the whole surface */
    5.14 +    if (!rect) {
    5.15 +        SDL_Window *window = renderer->window;
    5.16 +
    5.17 +        full_rect.x = 0;
    5.18 +        full_rect.y = 0;
    5.19 +        full_rect.w = window->w;
    5.20 +        full_rect.h = window->h;
    5.21 +        rect = &full_rect;
    5.22 +    }
    5.23 +
    5.24 +    points[0].x = rect->x;
    5.25 +    points[0].y = rect->y;
    5.26 +    points[1].x = rect->x+rect->w-1;
    5.27 +    points[1].y = rect->y;
    5.28 +    points[2].x = rect->x+rect->w-1;
    5.29 +    points[2].y = rect->y+rect->h-1;
    5.30 +    points[3].x = rect->x;
    5.31 +    points[3].y = rect->y+rect->h-1;
    5.32 +    points[4].x = rect->x;
    5.33 +    points[4].y = rect->y;
    5.34 +    return SDL_RenderDrawLines(renderer, points, 5);
    5.35  }
    5.36  
    5.37  int
    5.38 @@ -2340,20 +2366,11 @@
    5.39  
    5.40      /* Check for NULL rect, which means fill entire window */
    5.41      for (i = 0; i < count; ++i) {
    5.42 -        if (rects[i] == NULL) {
    5.43 -            SDL_Window *window = renderer->window;
    5.44 -            SDL_Rect full_rect;
    5.45 -            const SDL_Rect *rect;
    5.46 -
    5.47 -            full_rect.x = 0;
    5.48 -            full_rect.y = 0;
    5.49 -            full_rect.w = window->w;
    5.50 -            full_rect.h = window->h;
    5.51 -            rect = &full_rect;
    5.52 -            return renderer->RenderDrawRects(renderer, &rect, 1);
    5.53 +        if (SDL_RenderDrawRect(renderer, rects[i]) < 0) {
    5.54 +            return -1;
    5.55          }
    5.56      }
    5.57 -    return renderer->RenderDrawRects(renderer, rects, count);
    5.58 +    return 0;
    5.59  }
    5.60  
    5.61  int
     6.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Tue Feb 01 19:19:43 2011 -0800
     6.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Tue Feb 01 20:50:04 2011 -0800
     6.3 @@ -68,8 +68,6 @@
     6.4                                  const SDL_Point * points, int count);
     6.5  static int DirectFB_RenderDrawLines(SDL_Renderer * renderer,
     6.6                                 const SDL_Point * points, int count);
     6.7 -static int DirectFB_RenderDrawRects(SDL_Renderer * renderer,
     6.8 -		const SDL_Rect ** rects, int count);
     6.9  static int DirectFB_RenderFillRects(SDL_Renderer * renderer,
    6.10  		const SDL_Rect ** rects, int count);
    6.11  static int DirectFB_RenderCopy(SDL_Renderer * renderer,
    6.12 @@ -271,7 +269,6 @@
    6.13      renderer->RenderDrawPoints = DirectFB_RenderDrawPoints;
    6.14      renderer->RenderDrawLines = DirectFB_RenderDrawLines;
    6.15      renderer->RenderFillRects = DirectFB_RenderFillRects;
    6.16 -    renderer->RenderDrawRects = DirectFB_RenderDrawRects;
    6.17      /* RenderDrawEllipse - no reference implementation yet */
    6.18      /* RenderFillEllipse - no reference implementation yet */
    6.19      renderer->RenderCopy = DirectFB_RenderCopy;
    6.20 @@ -817,24 +814,6 @@
    6.21  }
    6.22  
    6.23  static int
    6.24 -DirectFB_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
    6.25 -{
    6.26 -    DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
    6.27 -    SDL_DFB_WINDOWSURFACE(data->window);
    6.28 -    int i;
    6.29 -
    6.30 -    PrepareDraw(renderer);
    6.31 -
    6.32 -    for (i=0; i<count; i++)
    6.33 -    	SDL_DFB_CHECKERR(destsurf->DrawRectangle(destsurf, rects[i]->x, rects[i]->y,
    6.34 -    			rects[i]->w, rects[i]->h));
    6.35 -
    6.36 -    return 0;
    6.37 -  error:
    6.38 -    return -1;
    6.39 -}
    6.40 -
    6.41 -static int
    6.42  DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
    6.43  {
    6.44      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
     7.1 --- a/src/video/dummy/SDL_nullrender.c	Tue Feb 01 19:19:43 2011 -0800
     7.2 +++ b/src/video/dummy/SDL_nullrender.c	Tue Feb 01 20:50:04 2011 -0800
     7.3 @@ -35,8 +35,6 @@
     7.4                                        const SDL_Point * points, int count);
     7.5  static int SDL_DUMMY_RenderDrawLines(SDL_Renderer * renderer,
     7.6                                       const SDL_Point * points, int count);
     7.7 -static int SDL_DUMMY_RenderDrawRects(SDL_Renderer * renderer,
     7.8 -                                     const SDL_Rect ** rects, int count);
     7.9  static int SDL_DUMMY_RenderFillRects(SDL_Renderer * renderer,
    7.10                                       const SDL_Rect ** rects, int count);
    7.11  static int SDL_DUMMY_RenderCopy(SDL_Renderer * renderer,
    7.12 @@ -100,7 +98,6 @@
    7.13  
    7.14      renderer->RenderDrawPoints = SDL_DUMMY_RenderDrawPoints;
    7.15      renderer->RenderDrawLines = SDL_DUMMY_RenderDrawLines;
    7.16 -    renderer->RenderDrawRects = SDL_DUMMY_RenderDrawRects;
    7.17      renderer->RenderFillRects = SDL_DUMMY_RenderFillRects;
    7.18      renderer->RenderCopy = SDL_DUMMY_RenderCopy;
    7.19      renderer->RenderReadPixels = SDL_DUMMY_RenderReadPixels;
    7.20 @@ -168,28 +165,6 @@
    7.21  }
    7.22  
    7.23  static int
    7.24 -SDL_DUMMY_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    7.25 -                          int count)
    7.26 -{
    7.27 -    SDL_DUMMY_RenderData *data =
    7.28 -        (SDL_DUMMY_RenderData *) renderer->driverdata;
    7.29 -    SDL_Surface *target = data->screen;
    7.30 -
    7.31 -    if (renderer->blendMode == SDL_BLENDMODE_NONE) {
    7.32 -        Uint32 color = SDL_MapRGBA(target->format,
    7.33 -                                   renderer->r, renderer->g, renderer->b,
    7.34 -                                   renderer->a);
    7.35 -
    7.36 -        return SDL_DrawRects(target, rects, count, color);
    7.37 -    } else {
    7.38 -        return SDL_BlendRects(target, rects, count,
    7.39 -                              renderer->blendMode,
    7.40 -                              renderer->r, renderer->g, renderer->b,
    7.41 -                              renderer->a);
    7.42 -    }
    7.43 -}
    7.44 -
    7.45 -static int
    7.46  SDL_DUMMY_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    7.47                            int count)
    7.48  {
     8.1 --- a/src/video/windows/SDL_d3drender.c	Tue Feb 01 19:19:43 2011 -0800
     8.2 +++ b/src/video/windows/SDL_d3drender.c	Tue Feb 01 20:50:04 2011 -0800
     8.3 @@ -114,8 +114,6 @@
     8.4                                  const SDL_Point * points, int count);
     8.5  static int D3D_RenderDrawLines(SDL_Renderer * renderer,
     8.6                                 const SDL_Point * points, int count);
     8.7 -static int D3D_RenderDrawRects(SDL_Renderer * renderer,
     8.8 -                               const SDL_Rect ** rects, int count);
     8.9  static int D3D_RenderFillRects(SDL_Renderer * renderer,
    8.10                                 const SDL_Rect ** rects, int count);
    8.11  static int D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    8.12 @@ -446,7 +444,6 @@
    8.13      renderer->DirtyTexture = D3D_DirtyTexture;
    8.14      renderer->RenderDrawPoints = D3D_RenderDrawPoints;
    8.15      renderer->RenderDrawLines = D3D_RenderDrawLines;
    8.16 -    renderer->RenderDrawRects = D3D_RenderDrawRects;
    8.17      renderer->RenderFillRects = D3D_RenderFillRects;
    8.18      renderer->RenderCopy = D3D_RenderCopy;
    8.19      renderer->RenderReadPixels = D3D_RenderReadPixels;
    8.20 @@ -987,71 +984,6 @@
    8.21  }
    8.22  
    8.23  static int
    8.24 -D3D_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    8.25 -                    int count)
    8.26 -{
    8.27 -    D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
    8.28 -    DWORD color;
    8.29 -    int i;
    8.30 -    Vertex vertices[5];
    8.31 -    HRESULT result;
    8.32 -
    8.33 -    if (data->beginScene) {
    8.34 -        IDirect3DDevice9_BeginScene(data->device);
    8.35 -        data->beginScene = SDL_FALSE;
    8.36 -    }
    8.37 -
    8.38 -    D3D_SetBlendMode(data, renderer->blendMode);
    8.39 -
    8.40 -    result =
    8.41 -        IDirect3DDevice9_SetTexture(data->device, 0,
    8.42 -                                    (IDirect3DBaseTexture9 *) 0);
    8.43 -    if (FAILED(result)) {
    8.44 -        D3D_SetError("SetTexture()", result);
    8.45 -        return -1;
    8.46 -    }
    8.47 -
    8.48 -    color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
    8.49 -
    8.50 -    for (i = 0; i < SDL_arraysize(vertices); ++i) {
    8.51 -        vertices[i].z = 0.0f;
    8.52 -        vertices[i].rhw = 1.0f;
    8.53 -        vertices[i].color = color;
    8.54 -        vertices[i].u = 0.0f;
    8.55 -        vertices[i].v = 0.0f;
    8.56 -    }
    8.57 -
    8.58 -    for (i = 0; i < count; ++i) {
    8.59 -        const SDL_Rect *rect = rects[i];
    8.60 -
    8.61 -        vertices[0].x = (float) rect->x;
    8.62 -        vertices[0].y = (float) rect->y;
    8.63 -
    8.64 -        vertices[1].x = (float) rect->x+rect->w-1;
    8.65 -        vertices[1].y = (float) rect->y;
    8.66 -
    8.67 -        vertices[2].x = (float) rect->x+rect->w-1;
    8.68 -        vertices[2].y = (float) rect->y+rect->h-1;
    8.69 -
    8.70 -        vertices[3].x = (float) rect->x;
    8.71 -        vertices[3].y = (float) rect->y+rect->h-1;
    8.72 -
    8.73 -        vertices[4].x = (float) rect->x;
    8.74 -        vertices[4].y = (float) rect->y;
    8.75 -
    8.76 -        result =
    8.77 -            IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, 4,
    8.78 -                                             vertices, sizeof(*vertices));
    8.79 -
    8.80 -        if (FAILED(result)) {
    8.81 -            D3D_SetError("DrawPrimitiveUP()", result);
    8.82 -            return -1;
    8.83 -        }
    8.84 -    }
    8.85 -    return 0;
    8.86 -}
    8.87 -
    8.88 -static int
    8.89  D3D_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects,
    8.90                      int count)
    8.91  {