public void FillShape(SolidBrush P, PolyLine Shape) { // GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); if (P.Color.A < 255) { GL.Enable(EnableCap.Blend); } var polygon = new Polygon(); List <Vertex> V = new List <Vertex>(); for (int i = 0; i < Shape.Count(); i++) { V.Add(new Vertex(Shape.Vertices[i].X, Shape.Vertices[i].Y)); } polygon.AddContour(V); var options = new ConstraintOptions() { ConformingDelaunay = true }; var quality = new QualityOptions() { MinimumAngle = 25 }; var mesh = polygon.Triangulate(options, quality); GL.Begin(BeginMode.Triangles); GL.Color4(P.Color.R, P.Color.G, P.Color.B, P.Color.A); foreach (var t in mesh.Triangles) { var A = t.GetVertex(0); var B = t.GetVertex(1); var C = t.GetVertex(2); GL.Vertex2(A.X, A.Y); GL.Vertex2(B.X, B.Y); GL.Vertex2(C.X, C.Y); } GL.End(); }