OGRE: Ogre::VertexBufferDownloadHelper Class Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Classes | Public Member Functions | Static Public Member Functions | List of all members
Ogre::VertexBufferDownloadHelper Class Reference
Core » Resources

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

`#include <OgreVertexBufferDownloadHelper.h>`

## Classes
struct | DownloadData

## Public Member Functions
const DownloadDataArray & | getDownloadData (void) 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 DownloadDataArray& Ogre::VertexBufferDownloadHelper::getDownloadData | ( | void |  | ) | const
| inline

## ◆ getNormal()

static Vector3 Ogre::VertexBufferDownloadHelper::getNormal | ( | uint8 const * | srcData,
|  | VertexElement2 | vertexElement
| ) |  |
| inlinestatic

References Ogre::v1::VertexElement::getBaseType(), Ogre::v1::VertexElement::getTypeSize(), Ogre::VertexElement2::mType, Ogre::Bitwise::snorm16ToFloat(), Ogre::VET_HALF2, Ogre::VET_SHORT4_SNORM, Ogre::Quaternion::w, Ogre::Quaternion::x, Ogre::Quaternion::xAxis(), Ogre::Quaternion::y, and Ogre::Quaternion::z.

## ◆ getVector4()

static Vector4 Ogre::VertexBufferDownloadHelper::getVector4 | ( | uint8 const * | srcData,
|  | VertexElement2 | vertexElement
| ) |  |
| inlinestatic

References Ogre::v1::VertexElement::getBaseType(), Ogre::v1::VertexElement::getTypeCount(), Ogre::v1::VertexElement::getTypeSize(), Ogre::Bitwise::halfToFloat(), Ogre::VertexElement2::mType, and Ogre::VET_HALF2.

## ◆ 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

  outDataPtrs | The 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

  vao | Vao to download from
  semanticsToDownload | Semantics from the Vao to download
  elementStart | Offset to start, in the vertex buffer.
  elementCount | Number 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:

- OgreVertexBufferDownloadHelper.h