public final class Batch extends java.lang.Object implements IDestroyable
BufferPool memory,
meaning no allocation (BufferPool is pre-allocated).
Batch is rendered efficiently and can be rendered with
hardware instancing (requires GLApiExt.instancing).Batch class offers low level rendering methods for rendering
with simple shading or with a specified Shader.Batch is also integrated in
the rendering pipeline Renderer.render(Batch, com.bonzaiengine.math.Transform,
com.bonzaiengine.material.IMaterial, int)| Modifier and Type | Class and Description |
|---|---|
static class |
Batch.CreateType |
static interface |
Batch.IBatchAttributes |
static class |
Batch.PolygonType |
| Modifier and Type | Method and Description |
|---|---|
void |
alloc(boolean hasUv,
boolean hasNrm,
boolean hasClr)
Allocate the reserved vertices and indices
|
void |
alloc(int numUv,
boolean hasNrm,
boolean hasClr) |
void |
destroy(IGLApi glApi) |
void |
disableColors()
Disable colors
|
void |
disableNormals()
Disable normals
|
void |
disableTexCoords()
Disable texture coordinates
|
void |
enableColors()
Enable colors
|
void |
enableNormals()
Enable normals
|
void |
enableTexCoords()
Enable texture coordinates
|
void |
free()
Free memory buffers
|
int |
getNumIndicesToRender() |
int |
getNumVertices() |
int |
getNumVerticesToRender() |
int |
getNumVerticesWritten() |
Batch.IBatchAttributes |
getUserAttributes() |
boolean |
hasColors() |
boolean |
hasNormals() |
boolean |
hasTexCoords() |
boolean |
isAllocated() |
static Batch |
newPersistent()
Persistent
Batch allocating persistent memory, must be destroyed with destroy(IGLApi) |
static Batch |
newVolatile()
Volatile
Batch allocating volatile memory in BufferPool |
void |
putLine(int i0,
int i1) |
void |
putLineLoop() |
void |
putLines() |
void |
putLineStrip() |
void |
putPatch(int... indices) |
void |
putPoint(int index) |
void |
putPoints() |
void |
putQuadAsTriangle(int i0,
int i1,
int i2,
int i3)
Put two triangles: (0,1,2) (0,2,3)
|
void |
putTriangle(int i0,
int i1,
int i2) |
void |
putTriangleFan() |
void |
putTriangles() |
void |
putTriangleStrip() |
void |
putVertex(float[] p,
float[] tc,
float[] n,
byte[] c) |
void |
putVertex(int numVertex,
float[] p,
float[] tc,
float[] n,
byte[] c) |
void |
render(IGLApi glApi,
boolean diffuseTexture,
boolean alphaTest)
Render the geometry with the specified texture, if any
|
void |
render(IGLApi glApi,
boolean diffuseTexture,
boolean alphaTest,
boolean sdFont,
Lights<?> lights) |
void |
reserve(int numVertices,
int numIndices,
Batch.PolygonType polygonType)
Reserve the specified vertices and indices for this
Batch. |
boolean |
rewind()
Rewind memory buffer after data are filled
|
void |
setDynamicHint(boolean dynamicHint) |
void |
setUserAttributes(Batch.IBatchAttributes userAttributes) |
public static final Batch newPersistent()
Batch allocating persistent memory, must be destroyed with destroy(IGLApi)Batchpublic static final Batch newVolatile()
Batch allocating volatile memory in BufferPoolBatchpublic void setDynamicHint(boolean dynamicHint)
dynamicHint - true to specified this Batch may be dynamically updatedpublic void setUserAttributes(Batch.IBatchAttributes userAttributes)
public Batch.IBatchAttributes getUserAttributes()
public void reserve(int numVertices,
int numIndices,
Batch.PolygonType polygonType)
Batch.polygonType is the samepublic boolean isAllocated()
public void alloc(boolean hasUv,
boolean hasNrm,
boolean hasClr)
reserve(int, int, PolygonType)public void alloc(int numUv,
boolean hasNrm,
boolean hasClr)
public void putVertex(float[] p,
float[] tc,
float[] n,
byte[] c)
public void putVertex(int numVertex,
float[] p,
float[] tc,
float[] n,
byte[] c)
public void putPoint(int index)
public void putPoints()
public void putLine(int i0,
int i1)
public void putLines()
public void putLineLoop()
public void putLineStrip()
public void putTriangle(int i0,
int i1,
int i2)
public void putTriangles()
public void putTriangleFan()
public void putTriangleStrip()
public void putQuadAsTriangle(int i0,
int i1,
int i2,
int i3)
public void putPatch(int... indices)
public boolean rewind()
public void free()
public int getNumVertices()
public int getNumVerticesWritten()
public int getNumVerticesToRender()
public int getNumIndicesToRender()
public boolean hasTexCoords()
public boolean hasNormals()
public boolean hasColors()
public void disableTexCoords()
public void enableTexCoords()
java.lang.IllegalStateException - if hasTexCoords() return falsepublic void disableNormals()
public void enableNormals()
java.lang.IllegalStateException - if hasNormals() return falsepublic void disableColors()
public void enableColors()
java.lang.IllegalStateException - if hasColors() return falsepublic void destroy(IGLApi glApi)
destroy in interface IDestroyablepublic void render(IGLApi glApi, boolean diffuseTexture, boolean alphaTest)
diffuseTexture - reference of the texture already binded, or null if not texturesBonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com