Class DrawBuffer
java.lang.Object
com.jozufozu.flywheel.backend.instancing.DrawBuffer
A byte buffer that can be used to draw vertices through a
DirectVertexConsumer.
The number of vertices needs to be known ahead of time.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbegin(int vertexCount) Creates a direct vertex consumer that can be used to write vertices into this buffer.booleanvoidinject(BufferBuilderExtension bufferBuilder) Injects the backing buffer into the given builder and prepares it for rendering.voidreset()Reset the draw buffer to have no vertices.
-
Constructor Details
-
DrawBuffer
@Internal public DrawBuffer(net.minecraft.client.renderer.RenderType parent)
-
-
Method Details
-
begin
Creates a direct vertex consumer that can be used to write vertices into this buffer.- Parameters:
vertexCount- The number of vertices to reserve memory for.- Returns:
- A direct vertex consumer.
- Throws:
IllegalStateException- If the buffer is already in use.
-
inject
Injects the backing buffer into the given builder and prepares it for rendering.- Parameters:
bufferBuilder- The buffer builder to inject into.
-
hasVertices
public boolean hasVertices()- Returns:
trueif the buffer has any vertices.
-
reset
public void reset()Reset the draw buffer to have no vertices. Does not clear the backing buffer.
-