Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ogre::DynamicRenderable Class Referenceabstract

Abstract base class providing mechanisms for dynamically growing hardware buffers. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/tools/DynamicRenderable.h>

Inheritance diagram for Ogre::DynamicRenderable:
Ogre::DynamicLines

Public Member Functions

 DynamicRenderable ()
 Constructor. More...
 
virtual ~DynamicRenderable ()
 Virtual destructor. More...
 
virtual Real getBoundingRadius (void) const override
 Implementation of SimpleRenderable. More...
 
virtual Real getSquaredViewDepth (const Camera *cam) const override
 Implementation of SimpleRenderable. More...
 
void initialize (RenderOperation::OperationType operationType, bool useIndices)
 Initializes the dynamic renderable. More...
 

Protected Member Functions

virtual void createVertexDeclaration ()=0
 Creates the vertex declaration. More...
 
virtual void fillHardwareBuffers ()=0
 Fills the hardware vertex and index buffers with data. More...
 
void prepareHardwareBuffers (size_t vertexCount, size_t indexCount)
 Prepares the hardware buffers for the requested vertex and index counts. More...
 

Protected Attributes

size_t mIndexBufferCapacity
 Maximum capacity of the currently allocated index buffer. More...
 
size_t mVertexBufferCapacity
 Maximum capacity of the currently allocated vertex buffer. More...
 

Detailed Description

Abstract base class providing mechanisms for dynamically growing hardware buffers.

Constructor & Destructor Documentation

Ogre::DynamicRenderable::DynamicRenderable ( )

Constructor.

Ogre::DynamicRenderable::~DynamicRenderable ( )
virtual

Virtual destructor.

Member Function Documentation

virtual void Ogre::DynamicRenderable::createVertexDeclaration ( )
protectedpure virtual

Creates the vertex declaration.

Remarks
Override and set mRenderOp.vertexData->vertexDeclaration here. mRenderOp.vertexData will be created for you before this method is called.

Implemented in Ogre::DynamicLines.

virtual void Ogre::DynamicRenderable::fillHardwareBuffers ( )
protectedpure virtual

Fills the hardware vertex and index buffers with data.

Remarks
This function must call prepareHardwareBuffers() before locking the buffers to ensure the they are large enough for the data to be written. Afterwards the vertex and index buffers (if using indices) can be locked, and data can be written to them.

Implemented in Ogre::DynamicLines.

Real Ogre::DynamicRenderable::getBoundingRadius ( void  ) const
overridevirtual

Implementation of SimpleRenderable.

Real Ogre::DynamicRenderable::getSquaredViewDepth ( const Camera *  cam) const
overridevirtual

Implementation of SimpleRenderable.

void Ogre::DynamicRenderable::initialize ( RenderOperation::OperationType  operationType,
bool  useIndices 
)

Initializes the dynamic renderable.

Remarks
This function should only be called once. It initializes the render operation, and calls the abstract function createVertexDeclaration().
Parameters
operationTypeThe type of render operation to perform.
useIndicesSpecifies whether to use indices to determine the vertices to use as input.
void Ogre::DynamicRenderable::prepareHardwareBuffers ( size_t  vertexCount,
size_t  indexCount 
)
protected

Prepares the hardware buffers for the requested vertex and index counts.

Remarks
This function must be called before locking the buffers in fillHardwareBuffers(). It guarantees that the hardware buffers are large enough to hold at least the requested number of vertices and indices (if using indices). The buffers are possibly reallocated to achieve this.
The vertex and index count in the render operation are set to the values of vertexCount and indexCount respectively.
Parameters
vertexCountThe number of vertices the buffer must hold.
indexCountThe number of indices the buffer must hold. This parameter is ignored if not using indices.

Member Data Documentation

size_t Ogre::DynamicRenderable::mIndexBufferCapacity
protected

Maximum capacity of the currently allocated index buffer.

size_t Ogre::DynamicRenderable::mVertexBufferCapacity
protected

Maximum capacity of the currently allocated vertex buffer.


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