Orxonox
0.0.5 Codename: Arcturus
|
Renderer class to interface with Ogre engine. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/external/ogreceguirenderer/OgreCEGUIRenderer.h>
Classes | |
struct | QuadInfo |
structure holding details about a quad to be drawn More... | |
struct | QuadVertex |
structure used for all vertices. More... | |
Public Member Functions | |
OgreCEGUIRenderer (Ogre::RenderWindow *window, Ogre::uint8 queue_id=Ogre::RENDER_QUEUE_OVERLAY, bool post_queue=false, uint max_quads=0) | |
Constructor for renderer class that uses Ogre for rendering. Note that if you use this option you must call setTargetSceneManager before rendering. More... | |
OgreCEGUIRenderer (Ogre::RenderWindow *window, Ogre::uint8 queue_id, bool post_queue, uint max_quads, Ogre::SceneManager *scene_manager) | |
Constructor for renderer class that uses Ogre for rendering. More... | |
virtual | ~OgreCEGUIRenderer (void) |
Destructor for Ogre renderer. More... | |
virtual void | addQuad (const Rect &dest_rect, float z, const Texture *tex, const Rect &texture_rect, const ColourRect &colours, QuadSplitMode quad_split_mode) |
virtual void | clearRenderList (void) |
virtual ResourceProvider * | createResourceProvider (void) |
virtual Texture * | createTexture (void) |
virtual Texture * | createTexture (const String &filename, const String &resourceGroup="General") |
virtual Texture * | createTexture (float size) |
Texture * | createTexture (Ogre::TexturePtr &texture) |
Create a texture from an existing Ogre::TexturePtr object. More... | |
virtual void | destroyAllTextures (void) |
virtual void | destroyTexture (Texture *texture) |
virtual void | doRender (void) |
virtual float | getHeight (void) const |
Return the current height of the display in pixels. More... | |
virtual uint | getHorzScreenDPI (void) const |
Return the horizontal display resolution dpi. More... | |
virtual uint | getMaxTextureSize (void) const |
Return the maximum texture size available. More... | |
virtual Rect | getRect (void) const |
Return a Rect describing the screen. More... | |
virtual Size | getSize (void) const |
Return the size of the display in pixels. More... | |
virtual uint | getVertScreenDPI (void) const |
Return the vertical display resolution dpi. More... | |
virtual float | getWidth (void) const |
Return the current width of the display in pixels. More... | |
virtual bool | isQueueingEnabled (void) const |
Return whether queueing is enabled. More... | |
void | setDisplaySize (const Size &sz) |
Set the size of the display in pixels. More... | |
virtual void | setQueueingEnabled (bool setting) |
Enable or disable the queueing of quads from this point on. More... | |
void | setTargetRenderQueue (Ogre::uint8 queue_id, bool post_queue) |
Set the target render queue for GUI rendering. More... | |
void | setTargetSceneManager (Ogre::SceneManager *scene_manager) |
Set the scene manager to be used for rendering the GUI. More... | |
Private Types | |
typedef std::multiset< QuadInfo > | QuadList |
Private Member Functions | |
uint32 | colourToOgre (const colour &col) const |
void | constructor_impl (Ogre::RenderWindow *window, Ogre::uint8 queue_id, bool post_queue, uint max_quads) |
void | initRenderStates (void) |
void | renderQuadDirect (const Rect &dest_rect, float z, const Texture *tex, const Rect &texture_rect, const ColourRect &colours, QuadSplitMode quad_split_mode) |
void | sortQuads (void) |
Private Attributes | |
Ogre::LayerBlendModeEx | d_alphaBlendMode |
Controls alpha blending mode used. More... | |
Ogre::HardwareVertexBufferSharedPtr | d_buffer |
vertex buffer to queue sprite rendering More... | |
size_t | d_bufferPos |
index into buffer where next vertex should be put. More... | |
Ogre::LayerBlendModeEx | d_colourBlendMode |
Controls colour blending mode used. More... | |
Ogre::TexturePtr | d_currTexture |
currently set texture; More... | |
Ogre::HardwareVertexBufferSharedPtr | d_direct_buffer |
Renderop for cursor. More... | |
Ogre::RenderOperation | d_direct_render_op |
Renderop for cursor. More... | |
Rect | d_display_area |
Ogre::Root * | d_ogre_root |
pointer to the Ogre root object that we attach to More... | |
CEGUIRQListener * | d_ourlistener |
bool | d_post_queue |
true if we render after everything else in our queue. More... | |
QuadList | d_quadlist |
Ogre::uint8 | d_queue_id |
ID of the queue that we are hooked into. More... | |
bool | d_queueing |
setting for queueing control. More... | |
Ogre::RenderOperation | d_render_op |
Ogre render operation we use to do our stuff. More... | |
Ogre::RenderSystem * | d_render_sys |
Pointer to the render system for Ogre. More... | |
Ogre::SceneManager * | d_sceneMngr |
The scene manager we are hooked into. More... | |
bool | d_sorted |
true when data in quad list is sorted. More... | |
Point | d_texelOffset |
Offset required for proper texel mapping. More... | |
std::list< OgreCEGUITexture * > | d_texturelist |
List used to track textures. More... | |
size_t | d_underused_framecount |
Number of frames elapsed since buffer utilization was above half the capacity. More... | |
Ogre::TextureUnitState::UVWAddressingMode | d_uvwAddressMode |
Static Private Attributes | |
static const size_t | UNDERUSED_FRAME_THRESHOLD = 50000 |
number of frames to wait before shrinking buffer More... | |
static const size_t | VERTEX_PER_QUAD = 6 |
number of vertices per quad More... | |
static const size_t | VERTEX_PER_TRIANGLE = 3 |
number of vertices for a triangle More... | |
static const size_t | VERTEXBUFFER_INITIAL_CAPACITY = 256 |
initial capacity of the allocated vertex buffer More... | |
Renderer class to interface with Ogre engine.
|
private |
CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer | ( | Ogre::RenderWindow * | window, |
Ogre::uint8 | queue_id = Ogre::RENDER_QUEUE_OVERLAY , |
||
bool | post_queue = false , |
||
uint | max_quads = 0 |
||
) |
Constructor for renderer class that uses Ogre for rendering. Note that if you use this option you must call setTargetSceneManager before rendering.
window | Pointer to an Ogre::RenderWindow object. |
queue_id | Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output. |
post_queue | set to true to have GUI rendered after render queue queue_id, or false to have the GUI rendered before render queue queue_id. |
max_quads | Obsolete. Set to 0. |
CEGUI::OgreCEGUIRenderer::OgreCEGUIRenderer | ( | Ogre::RenderWindow * | window, |
Ogre::uint8 | queue_id, | ||
bool | post_queue, | ||
uint | max_quads, | ||
Ogre::SceneManager * | scene_manager | ||
) |
Constructor for renderer class that uses Ogre for rendering.
window | Pointer to an Ogre::RenderWindow object. |
queue_id | Ogre::uint8 value that specifies where the GUI should appear in the ogre rendering output. |
post_queue | set to true to have GUI rendered after render queue queue_id, or false to have the GUI rendered before render queue queue_id. |
max_quads | Obsolete. Set to 0. |
scene_manager | Pointer to an Ogre::SceneManager object that is to be used for GUI rendering. |
|
virtual |
|
private |
|
private |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Texture * CEGUI::OgreCEGUIRenderer::createTexture | ( | Ogre::TexturePtr & | texture | ) |
Create a texture from an existing Ogre::TexturePtr object.
texture | pointer to an Ogre::TexturePtr object to be used as the basis for the new CEGUI::Texture |
|
virtual |
Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can reuse the vertex buffer resulting in a nice speed gain.
Resize vertex buffer if it is too small
Double buffer size until smaller than requested size
Reallocate the buffer
Resize vertex buffer if it has been to big for too long
Reset underused framecount so it takes another UNDERUSED_FRAME_THRESHOLD to half again
Fill the buffer
Render the buffer
If it has a different texture, render this quad in next operation also need to reset render states
Set texture, and do the render
Count frames to check if utilization of vertex buffer was below half the capacity for 500,000 frames
|
inlinevirtual |
Return the current height of the display in pixels.
|
inlinevirtual |
Return the horizontal display resolution dpi.
|
inlinevirtual |
Return the maximum texture size available.
|
inlinevirtual |
Return a Rect describing the screen.
|
inlinevirtual |
Return the size of the display in pixels.
|
inlinevirtual |
Return the vertical display resolution dpi.
|
inlinevirtual |
Return the current width of the display in pixels.
|
inlinevirtual |
Return whether queueing is enabled.
|
private |
void CEGUI::OgreCEGUIRenderer::setDisplaySize | ( | const Size & | sz | ) |
Set the size of the display in pixels.
You do not have to call this method under normal operation as the system will automatically extract the size from the current view port.
sz | Size object describing the size of the display. |
|
inlinevirtual |
Enable or disable the queueing of quads from this point on.
This only affects queueing. If queueing is turned off, any calls to addQuad will cause the quad to be rendered directly. Note that disabling queueing will not cause currently queued quads to be rendered, nor is the queue cleared - at any time the queue can still be drawn by calling doRender, and the list can be cleared by calling clearRenderList. Re-enabling the queue causes subsequent quads to be added as if queueing had never been disabled.
setting | true to enable queueing, or false to disable queueing (see notes above). |
void CEGUI::OgreCEGUIRenderer::setTargetRenderQueue | ( | Ogre::uint8 | queue_id, |
bool | post_queue | ||
) |
Set the target render queue for GUI rendering.
queue_id | Ogre::uint8 value specifying the render queue that the GUI system should attach to. |
post_queue |
|
void CEGUI::OgreCEGUIRenderer::setTargetSceneManager | ( | Ogre::SceneManager * | scene_manager | ) |
Set the scene manager to be used for rendering the GUI.
The GUI system will be unhooked from the current scene manager and attached to what ever is specified here.
scene_manager | Pointer to an Ogre::SceneManager object that is the new target Ogre::SceneManager to be used for GUI rendering. |
|
private |
Controls alpha blending mode used.
|
private |
vertex buffer to queue sprite rendering
|
private |
index into buffer where next vertex should be put.
|
private |
Controls colour blending mode used.
|
private |
currently set texture;
|
private |
Renderop for cursor.
|
private |
Renderop for cursor.
|
private |
|
private |
pointer to the Ogre root object that we attach to
|
private |
|
private |
true if we render after everything else in our queue.
|
private |
|
private |
ID of the queue that we are hooked into.
|
private |
setting for queueing control.
|
private |
Ogre render operation we use to do our stuff.
|
private |
Pointer to the render system for Ogre.
|
private |
The scene manager we are hooked into.
|
private |
true when data in quad list is sorted.
|
private |
Offset required for proper texel mapping.
|
private |
List used to track textures.
|
private |
Number of frames elapsed since buffer utilization was above half the capacity.
|
private |
|
staticprivate |
number of frames to wait before shrinking buffer
|
staticprivate |
number of vertices per quad
|
staticprivate |
number of vertices for a triangle
|
staticprivate |
initial capacity of the allocated vertex buffer