27 #ifndef _CEGUIOgreGeometryBuffer_h_
28 #define _CEGUIOgreGeometryBuffer_h_
30 #include "CEGUI/GeometryBuffer.h"
31 #include "CEGUI/RendererModules/Ogre/Renderer.h"
32 #include "CEGUI/Rect.h"
33 #include "CEGUI/Quaternion.h"
35 #include <OgreMatrix4.h>
36 #include <OgreColourValue.h>
37 #include <OgreRenderOperation.h>
38 #include <OgreTexture.h>
43 #ifdef CEGUI_USE_OGRE_HLMS
44 #include <OgreRenderable.h>
84 bool isClippingActive()
const;
107 Ogre::TexturePtr texture;
136 #ifdef CEGUI_USE_OGRE_HLMS
138 mutable Ogre::v1::RenderOperation d_renderOp;
140 mutable Ogre::v1::HardwareVertexBufferSharedPtr d_hwBuffer;
Class representing colour values within the system.
Definition: Colour.h:46
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
Implementation of CEGUI::GeometryBuffer for the Ogre engine.
Definition: RendererModules/Ogre/GeometryBuffer.h:58
virtual uint getVertexCount() const
Return the total number of vertices currently held by this GeometryBuffer object.
Ogre::RGBA colourToOgre(const Colour &col) const
convert CEGUI::colour into something Ogre can use
std::vector< OgreVertex > VertexList
type of container used to queue the geometry
Definition: RendererModules/Ogre/GeometryBuffer.h:154
void setClippingActive(const bool active)
Set whether clipping will be active for subsequently added vertices.
virtual void setTranslation(const Vector3f &v)
Set the translation to be applied to the geometry in the buffer when it is subsequently rendered.
Ogre::RenderSystem & d_renderSystem
Ogre render system we're to use.
Definition: RendererModules/Ogre/GeometryBuffer.h:115
const Ogre::Matrix4 & getMatrix() const
return the transformation matrix used for this buffer.
virtual void setRenderEffect(RenderEffect *effect)
Set the RenderEffect to be used by this GeometryBuffer.
virtual void draw() const
Draw the geometry buffered within this GeometryBuffer object.
void syncHardwareBuffer() const
Synchronise data in the hardware buffer with what's been added.
Rectf d_clipRect
rectangular clip region
Definition: RendererModules/Ogre/GeometryBuffer.h:119
VertexList d_vertices
container where added geometry is stored.
Definition: RendererModules/Ogre/GeometryBuffer.h:156
virtual void setRotation(const Quaternion &r)
Set the rotations to be applied to the geometry in the buffer when it is subsequently rendered.
std::vector< BatchInfo > BatchList
type of container that tracks BatchInfos.
Definition: RendererModules/Ogre/GeometryBuffer.h:150
void updateMatrix() const
update cached matrix
virtual uint getBatchCount() const
Return the number of batches of geometry that this GeometryBuffer has split the vertices into.
virtual void appendVertex(const Vertex &vertex)
Append a single vertex to the buffer.
Ogre::HardwareVertexBufferSharedPtr d_hwBuffer
H/W buffer where the vertices are rendered from.
Definition: RendererModules/Ogre/GeometryBuffer.h:145
bool d_clippingActive
whether clipping will be active for the current batch
Definition: RendererModules/Ogre/GeometryBuffer.h:121
OgreRenderer & d_owner
Renderer object that owns this GeometryBuffer.
Definition: RendererModules/Ogre/GeometryBuffer.h:113
Vector3f d_pivot
pivot point for rotation
Definition: RendererModules/Ogre/GeometryBuffer.h:127
virtual void setActiveTexture(Texture *texture)
Set the active texture to be used with all subsequently added vertices.
virtual void appendGeometry(const Vertex *const vbuff, uint vertex_count)
Append a number of vertices from an array to the GeometryBuffer.
virtual void setPivot(const Vector3f &p)
Set the pivot point to be used when applying the rotations.
RenderEffect * d_effect
RenderEffect that will be used by the GeometryBuffer.
Definition: RendererModules/Ogre/GeometryBuffer.h:129
Ogre::RenderOperation d_renderOp
Render operation for this buffer.
Definition: RendererModules/Ogre/GeometryBuffer.h:143
OgreGeometryBuffer(OgreRenderer &owner, Ogre::RenderSystem &rs)
Constructor.
virtual ~OgreGeometryBuffer()
Destructor.
BatchList d_batches
list of texture batches added to the geometry buffer
Definition: RendererModules/Ogre/GeometryBuffer.h:152
virtual RenderEffect * getRenderEffect()
Return the RenderEffect object that is assigned to this GeometryBuffer or 0 if none.
bool d_sync
whether the h/w buffer is in sync with the added geometry
Definition: RendererModules/Ogre/GeometryBuffer.h:148
virtual Texture * getActiveTexture() const
Return a pointer to the currently active Texture object. This may return 0 if no texture is set.
OgreTexture * d_activeTexture
Texture that is set as active.
Definition: RendererModules/Ogre/GeometryBuffer.h:117
void initialiseTextureStates() const
set up texture related states
Vector3f d_translation
translation vector
Definition: RendererModules/Ogre/GeometryBuffer.h:123
virtual void reset()
Clear all buffered data and reset the GeometryBuffer to the default state.
Vector2f d_texelOffset
offset to be applied to all geometry
Definition: RendererModules/Ogre/GeometryBuffer.h:131
virtual void setClippingRegion(const Rectf ®ion)
Set the clipping region to be used when rendering this buffer.
bool d_matrixValid
true when d_matrix is valid and up to date
Definition: RendererModules/Ogre/GeometryBuffer.h:135
Quaternion d_rotation
rotation quaternion
Definition: RendererModules/Ogre/GeometryBuffer.h:125
Ogre::Matrix4 d_matrix
model matrix cache
Definition: RendererModules/Ogre/GeometryBuffer.h:133
CEGUI::Renderer implementation for the Ogre engine.
Definition: RendererModules/Ogre/Renderer.h:92
Implementation of the CEGUI::Texture class for the Ogre engine.
Definition: RendererModules/Ogre/Texture.h:39
Class to represent rotation, avoids Gimbal lock.
Definition: Quaternion.h:69
Interface for objects that hook into RenderingWindow to affect the rendering process,...
Definition: RenderEffect.h:42
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
type to track info for per-texture sub batches of geometry
Definition: RendererModules/Ogre/GeometryBuffer.h:106
vertex structure used internally and also by Ogre.
Definition: RendererModules/Ogre/GeometryBuffer.h:98
structure that is used to hold details of a single vertex in 3D space.
Definition: Vertex.h:42