Allolib
1.0
C++ Components For Interactive Multimedia
|
Public Member Functions | |
int | size () const |
Get buffer store size, in bytes. | |
void | bufferType (unsigned int v) |
Set buffer type. | |
void | usage (unsigned int v) |
Set buffer usage. | |
void | bind () |
Bind buffer. | |
void | unbind () const |
Unbind buffer. | |
void | data (size_t size, void const *src=NULL) |
void | subdata (int offset, int size, void const *src) |
bool | created () const |
Returns whether object has been created. | |
void | create () |
Creates object on GPU. | |
void | destroy () |
Destroys object on GPU. | |
unsigned long | id () const |
Returns the assigned object id. | |
void | id (unsigned long v) |
void | validate () |
Ensure that the GPUObject is ready to use. More... | |
void | invalidate () |
Triggers re-creation of object safely. | |
Protected Member Functions | |
virtual void | onCreate () |
Called when currently assigned context is created. | |
virtual void | onDestroy () |
Called when currently assigned context is destroyed. | |
Protected Attributes | |
unsigned int | mType |
Set map mode. More... | |
unsigned int | mUsage |
size_t | mSize |
unsigned int | mID |
bool | mResubmit |
Vertex Buffer Objects (VBOs) create buffer memory for vertex attributes in high-performance memory (in contrast, Vertex Arrays store buffer memory in the client CPU, incurring the overhead of data transfer). If the buffer object is used to store pixel data, it is called Pixel Buffer Object (PBO).
VBOs provide an interface to access these buffers in a similar fashion to vertex arrays. Hints of 'target' and 'mode' help the implementation determine whether to use system, AGP or video memory.
Unlike display lists, the data in vertex buffer object can be read and updated by mapping the buffer into client's memory space.
Another important advantage of VBO is sharing the buffer objects with many clients, like display lists and textures. Since VBO is on the server's side, multiple clients will be able to access the same buffer with the corresponding identifier.
Definition at line 76 of file al_BufferObject.hpp.
|
inherited |
Ensure that the GPUObject is ready to use.
This is typically placed before any rendering implementation. If the object has been invalidated, the object will be destroyed and then created again. Otherwise, the object will simply be created if not already created.
|
protected |
Set map mode.
Map data store to client address space If successful, returns a valid pointer to the data, otherwise, it returns NULL. After using the pointer, call unmap() as soon as possible Map data store to client address space If successful, returns true and sets argument to address of data, otherwise, returns false and leaves argument unaffected. After using the pointer, call unmap() as soon as possible Unmaps data store from client address After unmap(), the mapped pointer is invalid
Definition at line 125 of file al_BufferObject.hpp.