Crazy Eddie's GUI System  0.8.4
CEGUI::Direct3D10GeometryBuffer Class Reference

Implementation of CEGUI::GeometryBuffer for the Direct3D 10 API. More...

+ Inheritance diagram for CEGUI::Direct3D10GeometryBuffer:
+ Collaboration diagram for CEGUI::Direct3D10GeometryBuffer:

List of all members.

Classes

struct  BatchInfo
 type to track info for per-texture sub batches of geometry More...
struct  D3DVertex
 internal Vertex structure used for Direct3D based geometry. More...

Public Member Functions

 Direct3D10GeometryBuffer (Direct3D10Renderer &owner)
 Constructor.
 ~Direct3D10GeometryBuffer ()
 Destructor.
const D3DXMATRIX * getMatrix () const
 return pointer to D3DXMATRIX used by this GeometryBuffer
void draw () const
 Draw the geometry buffered within this GeometryBuffer object.
void setTranslation (const Vector3f &v)
 Set the translation to be applied to the geometry in the buffer when it is subsequently rendered.
void setRotation (const Quaternion &r)
 Set the rotations to be applied to the geometry in the buffer when it is subsequently rendered.
void setPivot (const Vector3f &p)
 Set the pivot point to be used when applying the rotations.
void setClippingRegion (const Rectf &region)
 Set the clipping region to be used when rendering this buffer.
void appendVertex (const Vertex &vertex)
 Append a single vertex to the buffer.
void appendGeometry (const Vertex *const vbuff, uint vertex_count)
 Append a number of vertices from an array to the GeometryBuffer.
void setActiveTexture (Texture *texture)
 Set the active texture to be used with all subsequently added vertices.
void reset ()
 Clear all buffered data and reset the GeometryBuffer to the default state.
TexturegetActiveTexture () const
 Return a pointer to the currently active Texture object. This may return 0 if no texture is set.
uint getVertexCount () const
 Return the total number of vertices currently held by this GeometryBuffer object.
uint getBatchCount () const
 Return the number of batches of geometry that this GeometryBuffer has split the vertices into.
void setRenderEffect (RenderEffect *effect)
 Set the RenderEffect to be used by this GeometryBuffer.
RenderEffectgetRenderEffect ()
 Return the RenderEffect object that is assigned to this GeometryBuffer or 0 if none.
void setClippingActive (const bool active)
 Set whether clipping will be active for subsequently added vertices.
bool isClippingActive () const

Protected Types

typedef std::vector< BatchInfoBatchList
 type of container that tracks BatchInfos.
typedef std::vector< D3DVertexVertexList
 type of container used to queue the geometry

Protected Member Functions

void updateMatrix () const
 update cached matrix
void syncHardwareBuffer () const
 Synchronise data in the hardware buffer with what's been added.
void allocateVertexBuffer (const size_t count) const
 allocate the hardware vertex buffer large enough for count vertices.
void cleanupVertexBuffer () const
 cleanup the hardware vertex buffer.

Protected Attributes

Direct3D10Rendererd_owner
ID3D10Device & d_device
 The D3D Device.
Direct3D10Textured_activeTexture
 last texture that was set as active
ID3D10Buffer * d_vertexBuffer
 hardware buffer where vertices will be drawn from.
UINT d_bufferSize
 Size of the currently allocated vertex buffer.
bool d_bufferSynched
 whether the h/w buffer is in sync with the added geometry
BatchList d_batches
 list of texture batches added to the geometry buffer
VertexList d_vertices
 container where added geometry is stored.
Rectf d_clipRect
 rectangular clip region
bool d_clippingActive
 whether clipping will be active for the current batch
Vector3f d_translation
 translation vector
Quaternion d_rotation
 rotation Quaternion
Vector3f d_pivot
 pivot point for rotation
RenderEffectd_effect
 RenderEffect that will be used by the GeometryBuffer.
D3DXMATRIX d_matrix
 model matrix cache
bool d_matrixValid
 true when d_matrix is valid and up to date

Detailed Description

Implementation of CEGUI::GeometryBuffer for the Direct3D 10 API.


Member Function Documentation

void CEGUI::Direct3D10GeometryBuffer::appendGeometry ( const Vertex *const  vbuff,
uint  vertex_count 
) [virtual]

Append a number of vertices from an array to the GeometryBuffer.

Parameters:
vbuffPointer to an array of Vertex objects that describe the vertices that are to be added to the GeometryBuffer.
vertex_countThe number of Vertex objects from the array vbuff that are to be added to the GeometryBuffer.

Implements CEGUI::GeometryBuffer.

void CEGUI::Direct3D10GeometryBuffer::appendVertex ( const Vertex vertex) [virtual]

Append a single vertex to the buffer.

Parameters:
vertexVertex object describing the vertex to be added to the GeometryBuffer.

Implements CEGUI::GeometryBuffer.

Return a pointer to the currently active Texture object. This may return 0 if no texture is set.

Returns:
Pointer the Texture object that is currently active, or 0 if texturing is not being used.

Implements CEGUI::GeometryBuffer.

Return the number of batches of geometry that this GeometryBuffer has split the vertices into.

Note:
How batching is done will be largely implementation specific, although it would be reasonable to expect that you will have at least one batch of geometry per texture switch.
Returns:
The number of batches of geometry held by the GeometryBuffer.

Implements CEGUI::GeometryBuffer.

Return the total number of vertices currently held by this GeometryBuffer object.

Returns:
The number of vertices that have been appended to this GeometryBuffer.

Implements CEGUI::GeometryBuffer.

Set the active texture to be used with all subsequently added vertices.

Parameters:
texturePointer to a Texture object that shall be used for subsequently added vertices. This may be 0, in which case texturing will be disabled for subsequently added vertices.

Implements CEGUI::GeometryBuffer.

void CEGUI::Direct3D10GeometryBuffer::setClippingActive ( const bool  active) [virtual]

Set whether clipping will be active for subsequently added vertices.

Parameters:
active
  • true if vertices added after this call should be clipped to the clipping region defined for this GeometryBuffer.
  • false if vertices added after this call should not be clipped (other than to the edges of rendering target.

Implements CEGUI::GeometryBuffer.

void CEGUI::Direct3D10GeometryBuffer::setPivot ( const Vector3f p) [virtual]

Set the pivot point to be used when applying the rotations.

Parameters:
pVector3 describing the location of the pivot point to be used when applying the rotation to the geometry.

Implements CEGUI::GeometryBuffer.

Set the RenderEffect to be used by this GeometryBuffer.

Parameters:
effectPointer to the RenderEffect to be used during renderng of the GeometryBuffer. May be 0 to remove a previously added RenderEffect.
Note:
When adding a RenderEffect, the GeometryBuffer does not take ownership of, nor make a copy of, the passed RenderEffect - this means you need to be careful not to delete the RenderEffect if it might still be in use!

Implements CEGUI::GeometryBuffer.

Set the rotations to be applied to the geometry in the buffer when it is subsequently rendered.

Parameters:
rQuaternion describing the rotation to be used.

Implements CEGUI::GeometryBuffer.

Set the translation to be applied to the geometry in the buffer when it is subsequently rendered.

Parameters:
vVector3 describing the three axis translation vector to be used.

Implements CEGUI::GeometryBuffer.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends