Crazy Eddies GUI System  0.7.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CEGUIDirectFBGeometryBuffer.h
1 /***********************************************************************
2  filename: CEGUIDirectFBGeometryBuffer.h
3  created: Tue Mar 10 2009
4  author: Paul D Turner (parts based on code by Keith Mok)
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files (the
11  * "Software"), to deal in the Software without restriction, including
12  * without limitation the rights to use, copy, modify, merge, publish,
13  * distribute, sublicense, and/or sell copies of the Software, and to
14  * permit persons to whom the Software is furnished to do so, subject to
15  * the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIDirectFBGeometryBuffer_h_
29 #define _CEGUIDirectFBGeometryBuffer_h_
30 
31 #include "../../CEGUIGeometryBuffer.h"
32 #include "../../CEGUIRect.h"
33 #include <directfb.h>
34 #include <vector>
35 
36 
37 // Start of CEGUI namespace section
38 namespace CEGUI
39 {
40 class DirectFBRenderer;
41 class DirectFBTexture;
42 
45 {
46 public:
51 
52  // Implement GeometryBuffer interface.
53  void draw() const;
54  void setTranslation(const Vector3& v);
55  void setRotation(const Vector3& r);
56  void setPivot(const Vector3& p);
57  void setClippingRegion(const Rect& region);
58  void appendVertex(const Vertex& vertex);
59  void appendGeometry(const Vertex* const vbuff, uint vertex_count);
60  void setActiveTexture(Texture* texture);
61  void reset();
62  Texture* getActiveTexture() const;
63  uint getVertexCount() const;
64  uint getBatchCount() const;
65  void setRenderEffect(RenderEffect* effect);
67 
68 protected:
70  void updateMatrix() const;
71 
77  typedef std::pair<IDirectFBSurface*, uint> BatchInfo;
79  typedef std::vector<BatchInfo> BatchList;
83  typedef std::vector<DFBVertex> VertexList;
97  mutable s32 d_matrix[9];
99  mutable bool d_matrixValid;
100 };
101 
102 } // End of CEGUI namespace section
103 
104 #endif // end of guard _CEGUIDirectFBGeometryBuffer_h_
void updateMatrix() const
update cached matrix
uint getVertexCount() const
Return the total number of vertices currently held by this GeometryBuffer object. ...
void setTranslation(const Vector3 &v)
Set the translation to be applied to the geometry in the buffer when it is subsequently rendered...
DirectFBRenderer & d_owner
DirectFBRenderer object that created and owns this GeometryBuffer.
Definition: CEGUIDirectFBGeometryBuffer.h:73
Interface for objects that hook into RenderingWindow to affect the rendering process, thus allowing various effects to be achieved.
Definition: CEGUIRenderEffect.h:41
uint getBatchCount() const
Return the number of batches of geometry that this GeometryBuffer has split the vertices into...
std::vector< BatchInfo > BatchList
type of container that tracks BatchInfos.
Definition: CEGUIDirectFBGeometryBuffer.h:79
Class used as a three dimensional vector.
Definition: CEGUIVector.h:130
void appendVertex(const Vertex &vertex)
Append a single vertex to the buffer.
structure that is used to hold details of a single vertex in 3D space.
Definition: CEGUIVertex.h:41
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: CEGUIGeometryBuffer.h:42
DirectFBGeometryBuffer(DirectFBRenderer &owner)
Constructor.
Rect d_clipRect
rectangular clip region
Definition: CEGUIDirectFBGeometryBuffer.h:87
void setClippingRegion(const Rect &region)
Set the clipping region to be used when rendering this buffer.
Vector3 d_translation
translation vector
Definition: CEGUIDirectFBGeometryBuffer.h:89
Abstract base class specifying the required interface for Texture objects.
Definition: CEGUITexture.h:50
void reset()
Clear all buffered data and reset the GeometryBuffer to the default state.
RenderEffect * d_effect
RenderEffect that will be used by the GeometryBuffer.
Definition: CEGUIDirectFBGeometryBuffer.h:95
Implemetation of CEGUI::GeometryBuffer for DirectFB.
Definition: CEGUIDirectFBGeometryBuffer.h:44
std::pair< IDirectFBSurface *, uint > BatchInfo
type to track info for per-texture sub batches of geometry
Definition: CEGUIDirectFBGeometryBuffer.h:77
Implementation of CEGUI::Texture interface using DirectFB.
Definition: CEGUIDirectFBTexture.h:39
Vector3 d_pivot
pivot point for rotation
Definition: CEGUIDirectFBGeometryBuffer.h:93
bool d_matrixValid
true when d_matrix is valid and up to date
Definition: CEGUIDirectFBGeometryBuffer.h:99
Implementation of CEGUI::Renderer interface using DirectFB.
Definition: CEGUIDirectFBRenderer.h:44
void setRenderEffect(RenderEffect *effect)
Set the RenderEffect to be used by this GeometryBuffer.
~DirectFBGeometryBuffer()
Destructor.
Vector3 d_rotation
rotation vector
Definition: CEGUIDirectFBGeometryBuffer.h:91
void setPivot(const Vector3 &p)
Set the pivot point to be used when applying the rotations.
void setActiveTexture(Texture *texture)
Set the active texture to be used with all subsequently added vertices.
VertexList d_vertices
container where added geometry is stored.
Definition: CEGUIDirectFBGeometryBuffer.h:85
void appendGeometry(const Vertex *const vbuff, uint vertex_count)
Append a number of vertices from an array to the GeometryBuffer.
RenderEffect * getRenderEffect()
Return the RenderEffect object that is assigned to this GeometryBuffer or 0 if none.
void draw() const
Draw the geometry buffered within this GeometryBuffer object.
s32 d_matrix[9]
model matrix cache
Definition: CEGUIDirectFBGeometryBuffer.h:97
void setRotation(const Vector3 &r)
Set the rotations to be applied to the geometry in the buffer when it is subsequently rendered...
std::vector< DFBVertex > VertexList
type of container used to queue the geometry
Definition: CEGUIDirectFBGeometryBuffer.h:83
DirectFBTexture * d_activeTexture
last texture that was set as active
Definition: CEGUIDirectFBGeometryBuffer.h:75
Texture * getActiveTexture() const
Return a pointer to the currently active Texture object. This may return 0 if no texture is set...
BatchList d_batches
list of texture batches added to the geometry buffer
Definition: CEGUIDirectFBGeometryBuffer.h:81
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44