Skip to content

Commit

Permalink
Support GL_POLYGON
Browse files Browse the repository at this point in the history
This can be trivially supported as a triangle fan, since polygons are
guaranteed to be convex and the vertices are specified in the same
order.
The difference will only be noticeable if the rendering mode is set to
GL_LINE, in which case we'll be producing more lines than needed: a
correct implementation would draw just the perimeter, while we'll draw
some internal lines too.
  • Loading branch information
mardy committed May 24, 2024
1 parent bf77f86 commit dcf0c69
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gc_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,7 @@ static unsigned char draw_mode(GLenum mode)
gxmode = GX_TRIANGLESTRIP;
break;
case GL_TRIANGLE_FAN:
case GL_POLYGON:
gxmode = GX_TRIANGLEFAN;
break;
case GL_TRIANGLES:
Expand All @@ -2059,8 +2060,6 @@ static unsigned char draw_mode(GLenum mode)
case GL_QUADS:
gxmode = GX_QUADS;
break;

case GL_POLYGON:
default:
return 0xff; // FIXME: Emulate these modes
}
Expand Down

0 comments on commit dcf0c69

Please sign in to comment.