Class LineBuffer
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Vertex array/buffer pair for drawing a colored line list with the default shader.
public class LineBufferInheritance
object ← LineBuffer
Constructors
LineBuffer(RendererContext, string, string)
Creates the GL objects and binds the shader's layout.
public LineBuffer(RendererContext rendererContext, string label, string shaderName = "default")Parameters
rendererContext RendererContext
Renderer context for loading the shader.
label string
Debug label of the GL objects.
shaderName string
Shader the lines are drawn with, taking a position and color per vertex.
Properties
Shader
The default shader the vertex layout is bound to.
public Shader Shader { get; }Property Value
VertexCount
Number of vertices currently uploaded.
public int VertexCount { get; }Property Value
int
Methods
Clear()
Drops the uploaded vertices.
public void Clear()Delete()
Deletes the GL objects.
public void Delete()Draw(uint)
Draws the lines, with the object id as instancing base for picking.
public void Draw(uint objectId = 0)Parameters
objectId uint
Object id used as instancing base for picking.
Draw(int, int, uint, PrimitiveType)
Draws a range of the uploaded vertices, with the object id as instancing base for picking.
public void Draw(int first, int count, uint objectId = 0, PrimitiveType primitive = PrimitiveType.Lines)Parameters
first int
Index of the first vertex to draw.
count int
Number of vertices to draw, two per segment or three per triangle.
objectId uint
Object id used as instancing base for picking.
primitive PrimitiveType
What the vertices make up.
Upload(List<SimpleVertex>)
Uploads the line vertices, two per segment.
public void Upload(List<SimpleVertex> vertices)Parameters
vertices List<SimpleVertex>
Upload(ReadOnlySpan<SimpleVertex>)
Uploads the line vertices, two per segment.
public void Upload(ReadOnlySpan<SimpleVertex> vertices)Parameters
vertices ReadOnlySpan<SimpleVertex>

