TINYGL: Fix off-by-one in TGL_LINE_LOOP/TGL_LINE_STRIP .
Also, draw last line from last point to first instead of first point to last as the latter leaves an unpainted pixel for some reason.
This commit is contained in:
parent
98696865df
commit
46fa5eb373
1 changed files with 2 additions and 2 deletions
|
@ -393,10 +393,10 @@ void RasterizationDrawCall::execute(bool restoreState) const {
|
|||
break;
|
||||
case TGL_LINE_STRIP:
|
||||
case TGL_LINE_LOOP:
|
||||
for(int i = 0; i < cnt; i++) {
|
||||
for(int i = 0; i < cnt - 1; i++) {
|
||||
gl_draw_line(c, &c->vertex[i], &c->vertex[i + 1]);
|
||||
}
|
||||
gl_draw_line(c, &c->vertex[0], &c->vertex[cnt - 1]);
|
||||
gl_draw_line(c, &c->vertex[cnt - 1], &c->vertex[0]);
|
||||
break;
|
||||
case TGL_TRIANGLES:
|
||||
for(int i = 0; i < cnt / 3; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue