OgreDynamicRenderable Class Reference
[Rendering]
#include <OgreDynamicRenderable.hh>
Inheritance diagram for OgreDynamicRenderable:
Detailed Description
Abstract base class providing mechanisms for dynamically growing hardware buffers.Public Member Functions | |
OgreDynamicRenderable () | |
virtual | ~OgreDynamicRenderable () |
void | Init (Ogre::RenderOperation::OperationType operationType, bool useIndices) |
void | SetOperationType (Ogre::RenderOperation::OperationType opType) |
Ogre::RenderOperation::OperationType | GetOperationType () const |
virtual Ogre::Real | getBoundingRadius (void) const |
virtual Ogre::Real | getSquaredViewDepth (const Ogre::Camera *cam) const |
Protected Member Functions | |
virtual void | CreateVertexDeclaration ()=0 |
void | PrepareHardwareBuffers (size_t vertexCount, size_t indexCount) |
virtual void | FillHardwareBuffers ()=0 |
Protected Attributes | |
size_t | vertexBufferCapacity |
size_t | indexBufferCapacity |
Constructor & Destructor Documentation
Constructor
virtual ~OgreDynamicRenderable | ( | ) | [virtual] |
Virtual destructor
Member Function Documentation
void Init | ( | Ogre::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:
-
operationType The type of render operation to perform. useIndices Specifies whether to use indices to determine the vertices to use as input.
void SetOperationType | ( | Ogre::RenderOperation::OperationType | opType | ) |
Set the render operation type
Reimplemented in OgreDynamicLines.
Ogre::RenderOperation::OperationType GetOperationType | ( | ) | const |
Get the render operation type
Reimplemented in OgreDynamicLines.
virtual Ogre::Real getBoundingRadius | ( | void | ) | const [virtual] |
Implementation of Ogre::SimpleRenderable
virtual Ogre::Real getSquaredViewDepth | ( | const Ogre::Camera * | cam | ) | const [virtual] |
Implementation of Ogre::SimpleRenderable
virtual void CreateVertexDeclaration | ( | ) | [protected, pure 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 OgreDynamicLines.
void 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:
-
vertexCount The number of vertices the buffer must hold. indexCount The number of indices the buffer must hold. This parameter is ignored if not using indices.
virtual void FillHardwareBuffers | ( | ) | [protected, pure 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 OgreDynamicLines.
Member Data Documentation
size_t vertexBufferCapacity [protected] |
Maximum capacity of the currently allocated vertex buffer.
size_t indexBufferCapacity [protected] |
Maximum capacity of the currently allocated index buffer.
The documentation for this class was generated from the following file: