public final class R2InstanceBatchedDynamic extends Object implements R2InstanceBatchedDynamicType
The default implementation of the R2InstanceBatchedDynamicType
interface.
This implementation manages a fixed size batch of N instances. It
stores per-instance matrices in a vertex buffer object, and uses an
"orphaning" strategy where the entire buffer storage is reallocated and
populated on each call to update(JCGLInterfaceGL33Type,
R2TransformContextType).
| Modifier and Type | Method and Description |
|---|---|
com.io7m.jcanephora.core.JCGLArrayObjectType |
arrayObject() |
void |
delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
Delete the current object.
|
void |
disableAll()
Disable rendering of all instances
|
void |
disableInstance(int id)
Disable rendering of the given instance.
|
int |
enabledCount() |
int |
enableInstance(R2TransformOrthogonalReadableType t)
Enable rendering of an instance with transform
t |
long |
instanceID() |
boolean |
isDeleted() |
int |
maximumSize() |
static R2InstanceBatchedDynamicType |
newBatch(R2IDPoolType pool,
com.io7m.jcanephora.core.api.JCGLArrayBuffersType g_ab,
com.io7m.jcanephora.core.api.JCGLArrayObjectsType g_ao,
com.io7m.jcanephora.core.JCGLArrayObjectUsableType o,
int count)
Construct a new batch of instances.
|
int |
renderCount() |
void |
update(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
R2TransformContextType context)
Update any data required for rendering on the GPU.
|
public static R2InstanceBatchedDynamicType newBatch(R2IDPoolType pool, com.io7m.jcanephora.core.api.JCGLArrayBuffersType g_ab, com.io7m.jcanephora.core.api.JCGLArrayObjectsType g_ao, com.io7m.jcanephora.core.JCGLArrayObjectUsableType o, int count)
pool - The ID poolg_ab - An array buffer interfaceg_ao - An array object interfaceo - An existing array objectcount - The maximum number of instances in the batchpublic int maximumSize()
maximumSize in interface R2InstanceBatchedDynamicTypepublic int enabledCount()
enabledCount in interface R2InstanceBatchedDynamicTypepublic int renderCount()
renderCount in interface R2InstanceBatchedTypepublic void disableAll()
R2InstanceBatchedDynamicTypedisableAll in interface R2InstanceBatchedDynamicTypepublic int enableInstance(R2TransformOrthogonalReadableType t)
R2InstanceBatchedDynamicTypetenableInstance in interface R2InstanceBatchedDynamicTypet - The transform for the instancepublic void disableInstance(int id)
R2InstanceBatchedDynamicTypedisableInstance in interface R2InstanceBatchedDynamicTypeid - The index of the instancepublic void update(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g,
R2TransformContextType context)
R2InstanceBatchedTypeupdate in interface R2InstanceBatchedTypeg - An OpenGL interfacecontext - The transform contextpublic com.io7m.jcanephora.core.JCGLArrayObjectType arrayObject()
arrayObject in interface R2InstanceBatchedTypepublic long instanceID()
instanceID in interface R2InstanceTypepublic void delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
throws R2Exception
R2DeletableTypedelete in interface R2DeletableTypeg - An OpenGL interfaceR2Exception - On errorspublic boolean isDeleted()
isDeleted in interface com.io7m.jcanephora.core.JCGLResourceUsableTypeCopyright © 2017 <code@io7m.com> http://io7m.com