OGRE-Next  3.0.0
Object-Oriented Graphics Rendering Engine
Ogre::VertexBufferDownloadHelper Class Reference

Ogre currently does not support deinterleaved vertex buffers. More...

#include <OgreVertexBufferDownloadHelper.h>

Classes

struct  DownloadData
 

Public Member Functions

const DownloadDataVec & getDownloadData () const
 
void map (uint8 const **outDataPtrs)
 Maps the buffers that have been downloaded with queueDownload. More...
 
void queueDownload (const VertexArrayObject *vao, const VertexElementSemanticFullArray &semanticsToDownload, size_t elementStart=0, size_t elementCount=0)
 Creates AsyncTickets to download GPU -> CPU the requested VertexElementSemantics from one or multiple vertex buffers in a Vao. More...
 
void unmap ()
 

Static Public Member Functions

static Vector3 getNormal (uint8 const *srcData, VertexElement2 vertexElement)
 
static Vector4 getVector4 (uint8 const *srcData, VertexElement2 vertexElement)
 

Detailed Description

Ogre currently does not support deinterleaved vertex buffers.

However it may in the future. Retrieving vertex data out of one or multiple buffers can be tricky.

This class helps with that issue.

Member Function Documentation

◆ getDownloadData()

const DownloadDataVec& Ogre::VertexBufferDownloadHelper::getDownloadData ( ) const
inline

◆ getNormal()

◆ getVector4()

◆ map()

void Ogre::VertexBufferDownloadHelper::map ( uint8 const **  outDataPtrs)

Maps the buffers that have been downloaded with queueDownload.

and outputs the pointers in outDataPtrs.

Remarks
queueDownload must have been called prior to this.
See also
VertexBufferDownloadHelper::queueDownload
VertexBufferDownloadHelper::unmap
VertexBufferDownloadHelper::getDownloadData
Parameters
outDataPtrsThe vertex data that was requested. outDataPtrs must have enough size, which is the number of semantics that was requested to queueDownload (i.e. semanticsToDownload.size())

None, some, or all elements in outDataPtrs[i] may alias each other, e.g. outDataPtrs[0] == outDataPtrs[1] is possible, and that just means that both vertex elements are present interleaved the same vertex buffer.

If outDataPtrs[i] is a nullptr that means the semantic was not found in the Vao.

◆ queueDownload()

void Ogre::VertexBufferDownloadHelper::queueDownload ( const VertexArrayObject vao,
const VertexElementSemanticFullArray semanticsToDownload,
size_t  elementStart = 0,
size_t  elementCount = 0 
)

Creates AsyncTickets to download GPU -> CPU the requested VertexElementSemantics from one or multiple vertex buffers in a Vao.

Parameters
vaoVao to download from
semanticsToDownloadSemantics from the Vao to download
elementStartOffset to start, in the vertex buffer.
elementCountNumber of vertices to download. When 0, we download all that remains.

◆ unmap()

void Ogre::VertexBufferDownloadHelper::unmap ( )

The documentation for this class was generated from the following file: