How to draw a filled polygon, non convex polygon if I have array of points ?
I am drawing Rectangle as ( in OnRenderObject function ):
GL.PushMatrix ();
// Set transformation matrix for drawing to
// match our transform
GL.MultMatrix (transform.localToWorldMatrix);
GL.Begin (GL.QUADS);
GL.Color (new Color (0.0f, 0.2f, 0.0f, 0.4F));
GL.Vertex3 (0, 0, 0);
GL.Vertex3 (0, 0, 1);
GL.Vertex3 (1, 0, 1);
GL.Vertex3 (1, 0, 0);
GL.Color (new Color (0.7f, 0.2f, 0, 0.8F));
GL.Vertex3 (1, 0, 1);
GL.Vertex3 (1, 0, 2);
GL.Vertex3 (2, 0, 2);
GL.Vertex3 (2, 0, 1);
GL.End ();
GL.PopMatrix ();
But how to draw a filled polygon with some color ?
( I managed to draw by doing triangulation of polygon and then draw GL.TRIANGLES but I wonder is there better and quicker solution).