コード例 #1
0
        public void Line(Vector2 from, Vector2 to, LineRenderOptions options)
        {
            GL.Enable(EnableCap.LineSmooth);
            GL.LineWidth(options.Width);
            GL.Color4(options.Color);

            GL.Begin(PrimitiveType.Lines);

            GL.Vertex2(ToGL(from));
            GL.Vertex2(ToGL(to));

            GL.End();
            GL.Disable(EnableCap.LineSmooth);
        }
コード例 #2
0
        public void Lines(IEnumerable <Vector2> points, PrimitiveType renderMode, LineRenderOptions options)
        {
            GL.Enable(EnableCap.LineSmooth);
            GL.LineWidth(options.Width);
            GL.Color4(options.Color);

            GL.Begin(renderMode);

            foreach (Vector2 point in points)
            {
                GL.Vertex2(ToGL(point));
            }

            GL.End();
            GL.Disable(EnableCap.LineSmooth);
        }