OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
#include <OgreGL3PlusVertexArrayObject.h>
Public Types | |
typedef FastArray< ReadRequests > | ReadRequestsArray |
Static Public Member Functions | |
static VertexElement2VecVec | getVertexDeclaration (const VertexBufferPackedVec &vertexBuffers) |
static void | mapAsyncTickets (ReadRequestsArray &tickets) |
Maps the buffers requested via. | |
static void | unmapAsyncTickets (ReadRequestsArray &tickets) |
Unmaps the buffers mapped via. | |
Public Attributes | |
GLint | mPrimType [2] |
Static Public Attributes | |
static VertexBufferPacked | msDummyVertexBuffer |
When a Vao doesn't have a vertex buffer, a dummy one is assigned for performance reasons (avoid checking if pointer is null, avoid crashing inside Ogre) | |
|
inline |
|
inherited |
Clones the vertex & index buffers and creates a new VertexArrayObject.
The only exception is when one of the vertex buffers is already in sharedBuffers, in which case the buffer in sharedBuffers.find(vertexBuffer)->second will be used without cloning (useful for cloning LODs).
vaoManager | The VaoManager needed to create the structures |
sharedBuffers | [in/out] Maps old vertex buffers to new vertex buffers so that we can reuse them. Optional. Use a null pointer to disable this feature. |
vertexBufferType | See BufferType. Must be set to a valid BufferType. Pass a negative value to keep the same type of the original buffer being cloned. |
indexBufferType | See BufferType. Must be set to a valid BufferType. Pass a negative value to keep the same type of the original buffer being cloned. |
|
inherited |
Returns the entire VertexElement2 descriptor in the vertex buffers.
semantic | Semantic to look for. |
outIndex | The index to mVertexBuffers[index] if it's found. Otherwise the value is left untouched. |
outIndex | The offset in bytes to retrieve the element in the vertex data. If the semantic isn't found, the value is left untouched. |
repeat | The number of times to skip a semantic before returning the hit. Useful when you have more than one VES_TEXTURE_COORDINATES for example. Set repeat = 0 to retrieve the first set of VES_TEXTURE_COORDINATES Set repeat = 1 to retrieve the second set of VES_TEXTURE_COORDINATES etc. |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
staticinherited |
|
inherited |
Gets the combined vertex declaration of all the vertex buffers.
Note that we iterate through all of them and allocate the vector. You should cache the result rather than calling this function frequently.
|
staticinherited |
Maps the buffers requested via.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
inherited |
Utility to get multiple pointers & read specific elements of the vertex, even if they're in separate buffers.
When two elements share the same buffer, only one ticket is created.
Example usage: VertexArrayObject::ReadRequestsArray requests; requests.push_back( VertexArrayObject::ReadRequests( VES_POSITION ) ); requests.push_back( VertexArrayObject::ReadRequests( VES_NORMALS ) ); vao->readRequests( requests ); vao->mapAsyncTickets( requests );
for( size_t i=0; i<numVertices; ++i ) { float const position = reinterpret_cast<const float>( requests[0].data ); float const normals = reinterpret_cast<const float>( requests[1].data );
requests[0].data += requests[0].vertexBuffer->getBytesPerElement(); requests[1].data += requests[1].vertexBuffer->getBytesPerElement(); }
vao->unmapAsyncTickets( requests );
requests | [in/out] Array filled with the semantic. |
skipRequestIfBufferHasShadowCopy | Avoid generating the AsyncTicket if the buffer has a shadow copy. Useful if you want to read directly from the shadow copy instead of downloading from the GPU. The 'data' variable will be filled immediately if there's a shadow copy available, and mapAsyncTickets can be safely called even if skipRequestIfBufferHasShadowCopy=true |
Limits the range of triangle primitives that is rendered.
For VAOs with index buffers, this controls the index start & count, akin to indexStart & indexCount from the v1 objects.
|
staticinherited |
Unmaps the buffers mapped via.
GLint Ogre::GL3PlusVertexArrayObject::mPrimType[2] |
|
staticinherited |
When a Vao doesn't have a vertex buffer, a dummy one is assigned for performance reasons (avoid checking if pointer is null, avoid crashing inside Ogre)