Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
It's not the last pixel, it's the rightmost pixel, or if they're both…
… the same x coordinate, the bottommost pixel.
  • Loading branch information
slouken committed Nov 21, 2009
1 parent 9aa1024 commit d182212
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/video/SDL_renderer_gl.c
Expand Up @@ -1155,9 +1155,17 @@ GL_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
data->glVertex2f(0.5f + x2, 0.5f + y2);
data->glEnd();

/* For some reason the second endpoint is skipped */
/* For some reason the rightmost or lowest endpoint is skipped */
data->glBegin(GL_POINTS);
data->glVertex2f(0.5f + x2, 0.5f + y2);
if (x1 > x2) {
data->glVertex2f(0.5f + x1, 0.5f + y1);
} else if (x2 > x1) {
data->glVertex2f(0.5f + x2, 0.5f + y2);
} else if (y1 > y2) {
data->glVertex2f(0.5f + x1, 0.5f + y1);
} else if (y2 > y1) {
data->glVertex2f(0.5f + x2, 0.5f + y2);
}
data->glEnd();

return 0;
Expand Down

0 comments on commit d182212

Please sign in to comment.