Package com.ardor3d.scenegraph
Class AbstractBufferData<T extends Buffer>
java.lang.Object
com.ardor3d.scenegraph.AbstractBufferData<T>
- Direct Known Subclasses:
FloatBufferData
,IndexBufferData
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Access mode of the buffer when using Vertex Buffer Objects. -
Field Summary
Modifier and TypeFieldDescriptionprotected T
Buffer holding the data.protected boolean
Flag for notifying the renderer that the VBO buffer needs to be updated.protected AbstractBufferData.VBOAccessMode
VBO Access mode for this buffer.protected ContextIdReference
<AbstractBufferData<T>> -
Method Summary
Modifier and TypeMethodDescriptionstatic void
cleanAllVBOs
(Renderer deleter) static void
cleanAllVBOs
(Renderer deleter, RenderContext context) static void
cleanExpiredVBOs
(Renderer deleter) Clean any VBO ids from the hardware, using the given Renderer object to do the work immediately, if given.Get the buffer holding the data.int
Gets the count.int
Gets the count.abstract int
int
boolean
abstract AbstractBufferData
<T> makeCopy()
void
read
(InputCapsule capsule) int
removeVBOID
(Object glContext) Removes any vbo id from this buffer's data for the given OpenGL context.void
Set the buffer holding the data.void
setNeedsRefresh
(boolean needsRefresh) void
setVboAccessMode
(AbstractBufferData.VBOAccessMode vboAccessMode) void
Sets the id for a vbo based on this buffer's data in regards to the given OpenGL context.void
write
(OutputCapsule capsule)
-
Field Details
-
_vboIdCache
-
_buffer
Buffer holding the data. -
_vboAccessMode
VBO Access mode for this buffer. -
_needsRefresh
protected boolean _needsRefreshFlag for notifying the renderer that the VBO buffer needs to be updated.
-
-
Method Details
-
getByteCount
public abstract int getByteCount()- Returns:
- the number of bytes per entry in the buffer. For example, an IntBuffer would return 4.
-
getBufferLimit
public int getBufferLimit()Gets the count.- Returns:
- the count
-
getBufferCapacity
public int getBufferCapacity()Gets the count.- Returns:
- the count
-
getBuffer
Get the buffer holding the data.- Returns:
- the buffer
-
setBuffer
Set the buffer holding the data.- Parameters:
buffer
- the buffer to set
-
getVBOID
- Parameters:
glContext
- the object representing the OpenGL context a vbo belongs to. SeeRenderContext.getGlContextRep()
- Returns:
- the vbo id of a vbo in the given context. If the vbo is not found in the given context, 0 is returned.
-
removeVBOID
Removes any vbo id from this buffer's data for the given OpenGL context.- Parameters:
glContext
- the object representing the OpenGL context a vbo would belong to. SeeRenderContext.getGlContextRep()
- Returns:
- the id removed or 0 if not found.
-
setVBOID
Sets the id for a vbo based on this buffer's data in regards to the given OpenGL context.- Parameters:
glContextRep
- the object representing the OpenGL context a vbo belongs to. SeeRenderContext.getGlContextRep()
vboId
- the vbo id of a vbo. To be valid, this must be not equals to 0.- Throws:
IllegalArgumentException
- if vboId is less than or equal to 0.
-
getVboAccessMode
-
setVboAccessMode
-
isNeedsRefresh
public boolean isNeedsRefresh() -
setNeedsRefresh
public void setNeedsRefresh(boolean needsRefresh) -
cleanAllVBOs
-
cleanAllVBOs
-
cleanExpiredVBOs
Clean any VBO ids from the hardware, using the given Renderer object to do the work immediately, if given. If not, we will delete in the next execution of the appropriate context's game task render queue.- Parameters:
deleter
- the Renderer to use. If null, execution will not occur immediately.
-
makeCopy
- Returns:
- a deep copy of this buffer data object
-
read
- Throws:
IOException
-
write
- Throws:
IOException
-