예제 #1
0
        public void AddLine(Vector2 a, Vector2 b, Color4 color)
        {
            DebugLineBufferIndices.Add(DebugLineBufferVertices.Count / 7);
            DebugLineBufferIndices.Add(DebugLineBufferVertices.Count / 7 + 1);

            DebugLineBufferVertices.AddRange(new float[]
            {
                a.X, a.Y, 0.4f, color.R, color.G, color.B, color.A,
                b.X, b.Y, 0.4f, color.R, color.G, color.B, color.A
            });
        }
예제 #2
0
 public void DrawDebugLines()
 {
     BindBuffers();
     VisualFactory.FillMaterial.Begin(MatrixFloats);
     VertexBuffer.SetData(DebugLineBufferVertices.ToArray(), BufferUsageHint.StreamDraw);
     IndexBuffer.SetData(DebugLineBufferIndices.ToArray(), BufferUsageHint.StreamDraw);
     GL.DrawElements(BeginMode.Lines, DebugLineBufferIndices.Count, DrawElementsType.UnsignedInt, 0);
     VisualFactory.FillMaterial.End();
     UnBindBuffers();
     DebugLineBufferVertices.Clear();
     DebugLineBufferIndices.Clear();
 }