public abstract class

VertexBufferObject

extends Object
implements IVertexBufferObject
java.lang.Object
   ↳ org.andengine.opengl.vbo.VertexBufferObject
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

TODO Extract a common base class from VertexBufferObject and ZeroMemoryVertexBufferObject (due to significant code duplication). For naming, maybe be inspired by the java ByteBuffer naming (i.e. HeapBackedFloatArrayVertexBufferObject, StreamBufferVertexBufferObject, SharedBufferStreamVertexBufferObject). (c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.

Summary

Nested Classes
enum VertexBufferObject.DrawType  
[Expand]
Inherited Constants
From interface org.andengine.opengl.vbo.IVertexBufferObject
Fields
protected final boolean mAutoDispose
protected final ByteBuffer mByteBuffer
protected final int mCapacity
protected boolean mDirtyOnHardware
protected boolean mDisposed
protected int mHardwareBufferID
protected final int mUsage
protected final VertexBufferObjectAttributes mVertexBufferObjectAttributes
protected final VertexBufferObjectManager mVertexBufferObjectManager
Public Constructors
VertexBufferObject(VertexBufferObjectManager pVertexBufferObjectManager, int pCapacity, VertexBufferObject.DrawType pDrawType, boolean pAutoDispose, VertexBufferObjectAttributes pVertexBufferObjectAttributes)
Public Methods
void bind(GLState pGLState)
void bind(GLState pGLState, ShaderProgram pShaderProgram)
void dispose()
void draw(int pPrimitiveType, int pCount)
void draw(int pPrimitiveType, int pOffset, int pCount)
int getByteCapacity()
int getCapacity()
int getGPUMemoryByteSize()
int getHardwareBufferID()
VertexBufferObjectManager getVertexBufferObjectManager()
boolean isAutoDispose()
boolean isDirtyOnHardware()
boolean isDisposed()
boolean isLoadedToHardware()
void setDirtyOnHardware()
Mark this VertexBufferObject dirty so it gets updated on the hardware.
void setNotLoadedToHardware()
Mark this VertexBufferObject as not not loaded to hardware.
void unbind(GLState pGLState, ShaderProgram pShaderProgram)
void unloadFromHardware(GLState pGLState)
Protected Methods
void finalize()
abstract void onBufferData()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.andengine.opengl.vbo.IVertexBufferObject
From interface org.andengine.util.IDisposable

Fields

protected final boolean mAutoDispose

protected final ByteBuffer mByteBuffer

protected final int mCapacity

protected boolean mDirtyOnHardware

protected boolean mDisposed

protected int mHardwareBufferID

protected final int mUsage

protected final VertexBufferObjectAttributes mVertexBufferObjectAttributes

protected final VertexBufferObjectManager mVertexBufferObjectManager

Public Constructors

public VertexBufferObject (VertexBufferObjectManager pVertexBufferObjectManager, int pCapacity, VertexBufferObject.DrawType pDrawType, boolean pAutoDispose, VertexBufferObjectAttributes pVertexBufferObjectAttributes)

Parameters
pAutoDispose when passing true this VertexBufferObject loads itself to the active VertexBufferObjectManager. WARNING: When passing false one needs to take care of that by oneself!
pVertexBufferObjectAttributes to be automatically enabled on the ShaderProgram used in VertexBufferObject#bind(ShaderProgram).

Public Methods

public void bind (GLState pGLState)

public void bind (GLState pGLState, ShaderProgram pShaderProgram)

public void dispose ()

public void draw (int pPrimitiveType, int pCount)

public void draw (int pPrimitiveType, int pOffset, int pCount)

public int getByteCapacity ()

public int getCapacity ()

public int getGPUMemoryByteSize ()

public int getHardwareBufferID ()

public VertexBufferObjectManager getVertexBufferObjectManager ()

public boolean isAutoDispose ()

public boolean isDirtyOnHardware ()

public boolean isDisposed ()

public boolean isLoadedToHardware ()

public void setDirtyOnHardware ()

Mark this VertexBufferObject dirty so it gets updated on the hardware.

public void setNotLoadedToHardware ()

Mark this VertexBufferObject as not not loaded to hardware. It will reload itself to hardware when it gets used again.

public void unbind (GLState pGLState, ShaderProgram pShaderProgram)

public void unloadFromHardware (GLState pGLState)

Protected Methods

protected void finalize ()

Throws
Throwable

protected abstract void onBufferData ()