Class UnifiedRenderBuffer
java.lang.Object
dev.pfaff.altargui.render.AbstractVertexArrayObject
dev.pfaff.altargui.render.UnifiedRenderBuffer
- All Implemented Interfaces:
Closeable
,AutoCloseable
A reusable buffer for unified rendering. Every rendered element is made up of triangles. The
entire scene is emitted to a single buffer and then rendered with a single draw call.
-
Field Summary
FieldsFields inherited from class dev.pfaff.altargui.render.AbstractVertexArrayObject
vertexArrayId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
beginUploadingInstances
(int capacity) int
void
close()
void
draw()
This callspreDraw()
andpostDraw()
for you.void
drawRange
(int first, int count) void
int
void
postDraw()
void
preDraw()
void
uploadInstance
(Uploadable uploadable) Uploads an instance to the buffer.Methods inherited from class dev.pfaff.altargui.render.AbstractVertexArrayObject
bind, bound, unbind
-
Field Details
-
VERTEX_SPEC
-
verticesBuffer
-
-
Constructor Details
-
UnifiedRenderBuffer
public UnifiedRenderBuffer()
-
-
Method Details
-
beginUploadingInstances
public void beginUploadingInstances(int capacity) -
finishUploadingInstances
public void finishUploadingInstances() -
uploadInstance
Uploads an instance to the buffer.beginUploadingInstances(int)
must have been called already. -
preDraw
public void preDraw() -
postDraw
public void postDraw() -
draw
public void draw()This callspreDraw()
andpostDraw()
for you. -
drawRange
public void drawRange(int first, int count) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractVertexArrayObject
-
instanceCount
public int instanceCount() -
byteCount
public int byteCount()
-