Drawing concave polygons


I’m looking for example of drawing concave polygons (in FILL mode).

Of course one of the solutions is to divide the original polygon in triangles, but is there any OpenGL alternative?

I heard it can be done with the stencil buffer. Is there any sample code?

Thanks in andvance

OpenGL redbook describes very well about drawing concave polygon using stencil buffer.

Here is my example using stencil buffer, drawing 3 non-convex polygons;

  1. simple concave quad.
  2. a polygon with a hole in it.
  3. self intersected polygon.
    It works #1 and #2 cases except #3.

Also, check out OpenGL Tessellator , too.

Thanks a lot
(How simply it was! :slight_smile: )