Пример #1
0
        void SendShapeToTeselator(VertexCachedTesselator <T> teselator, IVertexSource <T> vertexSource)
        {
            teselator.BeginPolygon();

            uint PathAndFlags = 0;
            T    x, y;
            bool haveBegunContour = false;

            while (!Path.IsStop(PathAndFlags = vertexSource.Vertex(out x, out y)))
            {
                if (Path.IsClose(PathAndFlags) ||
                    (haveBegunContour && Path.IsMoveTo(PathAndFlags)))
                {
                    teselator.EndContour();
                    haveBegunContour = false;
                }

                if (!Path.IsClose(PathAndFlags))
                {
                    if (!haveBegunContour)
                    {
                        teselator.BeginContour();
                        haveBegunContour = true;
                    }

                    teselator.AddVertex(x, y);
                }
            }

            if (haveBegunContour)
            {
                teselator.EndContour();
            }

#if use_timers
            OpenGLEndPolygonTimer.Start();
#endif
            teselator.EndPolygon();
#if use_timers
            OpenGLEndPolygonTimer.Stop();
#endif
        }
Пример #2
0
        void SendShapeToTeselator(VertexCachedTesselator teselator, IVertexSource vertexSource)
        {
            teselator.BeginPolygon();

            Path.FlagsAndCommand PathAndFlags = 0;
            double x, y;
            bool   haveBegunContour = false;

            while (!Path.is_stop(PathAndFlags = vertexSource.vertex(out x, out y)))
            {
                if (Path.is_close(PathAndFlags) ||
                    (haveBegunContour && Path.is_move_to(PathAndFlags)))
                {
                    teselator.EndContour();
                    haveBegunContour = false;
                }

                if (!Path.is_close(PathAndFlags))
                {
                    if (!haveBegunContour)
                    {
                        teselator.BeginContour();
                        haveBegunContour = true;
                    }

                    teselator.AddVertex(x, y);
                }
            }

            if (haveBegunContour)
            {
                teselator.EndContour();
            }

#if use_timers
            OpenGLEndPolygonTimer.Start();
#endif
            teselator.EndPolygon();
#if use_timers
            OpenGLEndPolygonTimer.Stop();
#endif
        }
Пример #3
0
        void SendShapeToTeselator(VertexCachedTesselator teselator, IVertexSource vertexSource)
        {
            teselator.BeginPolygon();

            Path.FlagsAndCommand PathAndFlags = 0;
            double x, y;
            bool haveBegunContour = false;
            while (!Path.is_stop(PathAndFlags = vertexSource.vertex(out x, out y)))
            {
                if (Path.is_close(PathAndFlags)
                    || (haveBegunContour && Path.is_move_to(PathAndFlags)))
                {
                    teselator.EndContour();
                    haveBegunContour = false;
                }

                if (!Path.is_close(PathAndFlags))
                {
                    if (!haveBegunContour)
                    {
                        teselator.BeginContour();
                        haveBegunContour = true;
                    }

                    teselator.AddVertex(x, y);
                }
            }

            if (haveBegunContour)
            {
                teselator.EndContour();
            }

#if use_timers
            OpenGLEndPolygonTimer.Start();
#endif
            teselator.EndPolygon();
#if use_timers
            OpenGLEndPolygonTimer.Stop();
#endif
        }