OgreDynamicRenderable Class Reference

#include <OgreDynamicRenderable.hh>

Inheritance diagram for OgreDynamicRenderable:

OgreDynamicLines List of all members.

Detailed Description

Abstract base class providing mechanisms for dynamically growing hardware buffers.

Public Types

enum  OperationType {

Public Member Functions

 OgreDynamicRenderable ()
virtual ~OgreDynamicRenderable ()
 Virtual destructor.
void Init (OperationType operationType, bool useIndices)
 Initializes the dynamic renderable.
void SetOperationType (OperationType opType)
 Set the render operation type.
OgreDynamicRenderable::OperationType GetOperationType () const
 Get the render operation type.
virtual Ogre::Real getBoundingRadius (void) const
 Implementation of Ogre::SimpleRenderable.
virtual Ogre::Real getSquaredViewDepth (const Ogre::Camera *cam) const
 Implementation of Ogre::SimpleRenderable.

Protected Member Functions

virtual void CreateVertexDeclaration ()=0
 Creates the vertex declaration.
void PrepareHardwareBuffers (size_t vertexCount, size_t indexCount)
 Prepares the hardware buffers for the requested vertex and index counts.
virtual void FillHardwareBuffers ()=0
 Fills the hardware vertex and index buffers with data.

Protected Attributes

size_t vertexBufferCapacity
 Maximum capacity of the currently allocated vertex buffer.
size_t indexBufferCapacity
 Maximum capacity of the currently allocated index buffer.

Member Enumeration Documentation

OT_POINT_LIST  A list of points, 1 vertex per point.
OT_LINE_LIST  A list of lines, 2 vertices per line.
OT_LINE_STRIP  A strip of connected lines, 1 vertex per line plus 1 start vertex.
OT_TRIANGLE_LIST  A list of triangles, 3 vertices per triangle.
OT_TRIANGLE_STRIP  A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that.
OT_TRIANGLE_FAN  A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that.

Member Function Documentation

void Init ( OperationType  operationType,
bool  useIndices 

Initializes the dynamic renderable.

This function should only be called once. It initializes the render operation, and calls the abstract function CreateVertexDeclaration().
operationType The type of render operation to perform.
useIndices Specifies whether to use indices to determine the vertices to use as input.

virtual void CreateVertexDeclaration (  )  [protected, pure virtual]

Creates the vertex declaration.

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.

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.
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.

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.

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

Last updated Aug 04 2007