Crazy Eddies GUI System
0.6.2
|
Renderer class to interface with OpenGL. More...
Public Member Functions | |
OpenGLRenderer (uint max_quads, ImageCodec *codec=0) | |
Constructor for OpenGL Renderer object. More... | |
OpenGLRenderer (uint max_quads, int width, int height, ImageCodec *codec=0) | |
Constructor for OpenGL Renderer object. More... | |
virtual | ~OpenGLRenderer (void) |
Destructor for OpenGLRenderer objects. | |
virtual void | addQuad (const Rect &dest_rect, float z, const Texture *tex, const Rect &texture_rect, const ColourRect &colours, QuadSplitMode quad_split_mode) |
Add a quad to the rendering queue. All clipping and other adjustments should have been made prior to calling this. More... | |
virtual void | doRender (void) |
Perform final rendering for all quads that have been queued for rendering. More... | |
virtual void | clearRenderList (void) |
Clears all queued quads from the render queue. More... | |
virtual void | setQueueingEnabled (bool setting) |
Enable or disable the queuing of quads from this point on. More... | |
virtual Texture * | createTexture (void) |
Creates a 'null' Texture object. More... | |
virtual Texture * | createTexture (const String &filename, const String &resourceGroup) |
Create a Texture object using the given image file. More... | |
virtual Texture * | createTexture (float size) |
Create a Texture object with the given pixel dimensions as specified by size. NB: Textures are always square. More... | |
virtual void | destroyTexture (Texture *texture) |
Destroy the given Texture object. More... | |
virtual void | destroyAllTextures (void) |
Destroy all Texture objects. More... | |
virtual bool | isQueueingEnabled (void) const |
Return whether queuing is enabled. More... | |
virtual float | getWidth (void) const |
Return the current width of the display in pixels. More... | |
virtual float | getHeight (void) const |
Return the current height of the display in pixels. More... | |
virtual Size | getSize (void) const |
Return the size of the display in pixels. More... | |
virtual Rect | getRect (void) const |
Return a Rect describing the screen. More... | |
virtual uint | getMaxTextureSize (void) const |
Return the maximum texture size available. More... | |
virtual uint | getHorzScreenDPI (void) const |
Return the horizontal display resolution dpi. More... | |
virtual uint | getVertScreenDPI (void) const |
Return the vertical display resolution dpi. More... | |
void | setDisplaySize (const Size &sz) |
Set the size of the display in pixels. More... | |
void | grabTextures (void) |
Grabs all the loaded textures from Texture RAM and stores them in a local data buffer. This function invalidates all textures, and restoreTextures must be called before any CEGUI rendering is done for predictable results. | |
void | restoreTextures (void) |
Restores all the loaded textures from the local data buffers previously created by 'grabTextures'. | |
ImageCodec & | getImageCodec (void) |
Retrieve the image codec used internaly. | |
void | setImageCodec (const String &codecName) |
Set the image codec to use for loading textures. | |
void | setImageCodec (ImageCodec *codec) |
Set the image codec to use from an existing image codec. More... | |
![]() | |
void | resetZValue (void) |
Reset the z co-ordinate for rendering. More... | |
void | advanceZValue (void) |
Update the z co-ordinate for the next major UI element (window). More... | |
float | getCurrentZ (void) const |
return the current Z value to use (equates to layer 0 for this UI element). More... | |
float | getZLayer (uint layer) const |
return the z co-ordinate to use for the requested layer on the current GUI element. More... | |
const String & | getIdentifierString () const |
Return identification string for the renderer module. If the internal id string has not been set by the Renderer module creator, a generic string of "Unknown renderer" will be returned. More... | |
virtual ResourceProvider * | createResourceProvider (void) |
![]() | |
EventSet () | |
Constructor for EventSet objects. | |
virtual | ~EventSet (void) |
Destructor for EventSet objects. | |
void | addEvent (const String &name) |
Add a new Event to the EventSet with the given name. More... | |
void | removeEvent (const String &name) |
Removes the Event with the given name. All connections to the event are disconnected. More... | |
void | removeAllEvents (void) |
Remove all Event objects from the EventSet. More... | |
bool | isEventPresent (const String &name) |
Checks to see if an Event with the given name is present in the EventSet. More... | |
virtual Event::Connection | subscribeEvent (const String &name, Event::Subscriber subscriber) |
Subscribes a handler to the named Event. If the named Event is not yet present in the EventSet, it is created and added. More... | |
virtual Event::Connection | subscribeEvent (const String &name, Event::Group group, Event::Subscriber subscriber) |
Subscribes a handler to the specified group of the named Event. If the named Event is not yet present in the EventSet, it is created and added. More... | |
virtual Event::Connection | subscribeScriptedEvent (const String &name, const String &subscriber_name) |
Subscribes the named Event to a scripted funtion. More... | |
virtual Event::Connection | subscribeScriptedEvent (const String &name, Event::Group group, const String &subscriber_name) |
Subscribes the specified group of the named Event to a scripted funtion. More... | |
virtual void | fireEvent (const String &name, EventArgs &args, const String &eventNamespace="") |
Fires the named event passing the given EventArgs object. More... | |
bool | isMuted (void) const |
Return whether the EventSet is muted or not. More... | |
void | setMutedState (bool setting) |
Set the mute state for this EventSet. More... | |
Iterator | getIterator (void) const |
Return a EventSet::Iterator object to iterate over the events currently added to the EventSet. | |
Static Public Member Functions | |
static void | setDefaultImageCodecName (const String &codecName) |
Set the name of the default image codec to be used. | |
static const String & | getDefaultImageCodecName () |
Get the name of the default image codec. | |
Additional Inherited Members | |
![]() | |
typedef ConstBaseIterator < EventMap > | Iterator |
![]() | |
static const String | EventNamespace |
Namespace for global events. | |
static const String | EventDisplaySizeChanged |
![]() | |
typedef std::map< String, Event *, String::FastLessCompare > | EventMap |
![]() | |
Event * | getEventObject (const String &name, bool autoAdd=false) |
Return a pointer to the Event object with the given name, optionally adding such an Event object to the EventSet if it does not already exist. More... | |
void | fireEvent_impl (const String &name, EventArgs &args) |
Implementation event firing member. | |
EventSet (EventSet &e) | |
EventSet & | operator= (EventSet &e) |
![]() | |
ResourceProvider * | d_resourceProvider |
Holds the pointer to the ResourceProvider object. | |
String | d_identifierString |
String that holds some id information about the renderer. | |
Renderer class to interface with OpenGL.
CEGUI::OpenGLRenderer::OpenGLRenderer | ( | uint | max_quads, |
ImageCodec * | codec = 0 |
||
) |
Constructor for OpenGL Renderer object.
max_quads | obsolete. Set to 0. |
codec | A pointer to a user provided image codec. The renderer does not take ownership of the codec object. |
References CEGUI::initialiseGLExtensions().
CEGUI::OpenGLRenderer::OpenGLRenderer | ( | uint | max_quads, |
int | width, | ||
int | height, | ||
ImageCodec * | codec = 0 |
||
) |
Constructor for OpenGL Renderer object.
max_quads | obsolete. Set to 0. |
width | width of the CEGUI viewport. |
height | height of the CEGUI viewport. |
codec | A pointer to a user provided image codec. The renderer does not take ownership of the codec object. |
References CEGUI::initialiseGLExtensions().
|
virtual |
Add a quad to the rendering queue. All clipping and other adjustments should have been made prior to calling this.
dest_rect | Rect object describing the destination area (values are in pixels) |
z | float value specifying the z co-ordinate / z order of the quad |
tex | pointer to the Texture object that holds the imagery to be rendered |
texture_rect | Rect object holding the area of tex that is to be rendered (values are in texture co-ordinates). |
colours | ColourRect object describing the colour values that are to be applied when rendering. |
quad_split_mode | One of the QuadSplitMode values specifying the way quads are split into triangles |
Implements CEGUI::Renderer.
|
virtual |
|
virtual |
Creates a 'null' Texture object.
Implements CEGUI::Renderer.
|
virtual |
Create a Texture object using the given image file.
filename | String object that specifies the path and filename of the image file to use when creating the texture. |
resourceGroup | Resource group identifier to be passed to the resource provider when loading the texture file. |
Implements CEGUI::Renderer.
References CEGUI::OpenGLTexture::loadFromFile().
|
virtual |
Create a Texture object with the given pixel dimensions as specified by size. NB: Textures are always square.
size | float value that specifies the size to use for the width and height when creating the new texture. |
Implements CEGUI::Renderer.
References CEGUI::OpenGLTexture::setOGLTextureSize().
|
virtual |
Destroy all Texture objects.
Implements CEGUI::Renderer.
References destroyTexture().
Referenced by ~OpenGLRenderer().
|
virtual |
Destroy the given Texture object.
texture | pointer to the Texture object to be destroyed |
Implements CEGUI::Renderer.
Referenced by destroyAllTextures().
|
virtual |
Perform final rendering for all quads that have been queued for rendering.
The contents of the rendering queue is retained and can be rendered again as required. If the contents is not required call clearRenderList().
Implements CEGUI::Renderer.
References CEGUI::TopLeftToBottomRight.
|
inlinevirtual |
Return the current height of the display in pixels.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return the horizontal display resolution dpi.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return the maximum texture size available.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return a Rect describing the screen.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return the size of the display in pixels.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return the vertical display resolution dpi.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return the current width of the display in pixels.
Implements CEGUI::Renderer.
|
inlinevirtual |
Return whether queuing is enabled.
Implements CEGUI::Renderer.
void CEGUI::OpenGLRenderer::setDisplaySize | ( | const Size & | sz | ) |
Set the size of the display in pixels.
If your viewport size changes, you can call this function with the new size in pixels to update the rendering area.
sz | Size object describing the size of the display. |
References CEGUI::Renderer::EventDisplaySizeChanged, CEGUI::Renderer::EventNamespace, CEGUI::EventSet::fireEvent(), CEGUI::Rect::getSize(), and CEGUI::Rect::setSize().
void CEGUI::OpenGLRenderer::setImageCodec | ( | ImageCodec * | codec | ) |
Set the image codec to use from an existing image codec.
In this case the renderer does not take the ownership of the image codec object.
codec | a pointer to an image codec object |
|
inlinevirtual |
Enable or disable the queuing of quads from this point on.
This only affects queuing. If queuing is turned off, any calls to addQuad will cause the quad to be rendered directly. Note that disabling queuing 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 queuing had never been disabled.
setting | true to enable queuing, or false to disable queuing (see notes above). |
Implements CEGUI::Renderer.