Crazy Eddie's GUI System
0.8.7
|
Common base class used for other OpenGL (desktop or ES) based renderer modules. More...
Public Member Functions | |
RenderTarget & | getDefaultRenderTarget () |
Returns the default RenderTarget object. The default render target is is typically one that targets the entire screen (or rendering window). More... | |
GeometryBuffer & | createGeometryBuffer () |
Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from any RenderQueues and call destroyGeometryBuffer when you want to destroy the GeometryBuffer. More... | |
void | destroyGeometryBuffer (const GeometryBuffer &buffer) |
Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function. Before destroying any GeometryBuffer you should ensure that it has been removed from any RenderQueue that was using it. More... | |
void | destroyAllGeometryBuffers () |
Destroy all GeometryBuffer objects created by this Renderer. | |
TextureTarget * | createTextureTarget () |
Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose it's content from one frame to another. More... | |
void | destroyTextureTarget (TextureTarget *target) |
Function that cleans up TextureTarget objects created with the createTextureTarget function. More... | |
void | destroyAllTextureTargets () |
Destory all TextureTarget objects created by this Renderer. | |
Texture & | createTexture (const String &name) |
Create a 'null' Texture object. More... | |
Texture & | createTexture (const String &name, const String &filename, const String &resourceGroup) |
Create a Texture object using the given image file. More... | |
Texture & | createTexture (const String &name, const Sizef &size) |
Create a Texture object with the given pixel dimensions as specified by size. More... | |
void | destroyTexture (Texture &texture) |
Destroy a Texture object that was previously created by calling the createTexture functions. More... | |
void | destroyTexture (const String &name) |
Destroy a Texture object that was previously created by calling the createTexture functions. More... | |
void | destroyAllTextures () |
Destroy all Texture objects created by this Renderer. | |
Texture & | getTexture (const String &name) const |
Return a Texture object that was previously created by calling the createTexture functions. More... | |
bool | isTextureDefined (const String &name) const |
Return whether a texture with the given name exists. | |
void | setDisplaySize (const Sizef &sz) |
Set the size of the display or host window in pixels for this Renderer object. More... | |
const Sizef & | getDisplaySize () const |
Return the size of the display or host window in pixels. More... | |
const Vector2f & | getDisplayDPI () const |
Return the resolution of the display or host window in dots per inch. More... | |
uint | getMaxTextureSize () const |
Return the pixel size of the maximum supported texture. More... | |
const String & | getIdentifierString () const |
Return identification string for the renderer module. More... | |
Texture & | createTexture (const String &name, GLuint tex, const Sizef &sz) |
Create a texture that uses an existing OpenGL texture with the specified size. Note that it is your responsibility to ensure that the OpenGL texture is valid and that the specified size is accurate. More... | |
void | enableExtraStateSettings (bool setting) |
Tells the renderer to initialise some extra states beyond what it directly needs itself for CEGUI. More... | |
void | grabTextures () |
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 () |
Restores all the loaded textures from the local data buffers previously created by 'grabTextures'. | |
virtual Sizef | getAdjustedTextureSize (const Sizef &sz) const |
Helper to return a valid texture size according to reported OpenGL capabilities. More... | |
virtual void | setupRenderingBlendMode (const BlendMode mode, const bool force=false)=0 |
set the render states for the specified BlendMode. | |
virtual bool | isS3TCSupported () const =0 |
virtual const mat4Pimpl * | getViewProjectionMatrix () |
Helper to return view projection matrix. More... | |
virtual void | setViewProjectionMatrix (const mat4Pimpl *viewProjectionMatrix) |
Helper to set the view projection matrix. More... | |
const CEGUI::Rectf & | getActiveViewPort () |
Helper to get the viewport. More... | |
void | setActiveRenderTarget (RenderTarget *renderTarget) |
Helper to set the active render target. More... | |
RenderTarget * | getActiveRenderTarget () |
Helper to get the active render target. More... | |
bool | isTexCoordSystemFlipped () const |
Returns if the texture coordinate system is vertically flipped or not. The original of a texture coordinate system is typically located either at the the top-left or the bottom-left. CEGUI, Direct3D and most rendering engines assume it to be on the top-left. OpenGL assumes it to be at the bottom left. More... | |
Public Member Functions inherited from CEGUI::Renderer | |
virtual void | beginRendering ()=0 |
Perform any operations required to put the system into a state ready for rendering operations to begin. | |
virtual void | endRendering ()=0 |
Perform any operations required to finalise rendering. | |
virtual | ~Renderer () |
Destructor. | |
Static Public Member Functions | |
static float | getNextPOTSize (const float f) |
Utility function that will return f if it's a power of two, or the next power of two up from f if it's not. | |
Protected Types | |
typedef std::vector< TextureTarget * > | TextureTargetList |
container type used to hold TextureTargets we create. | |
typedef std::vector< OpenGLGeometryBufferBase * > | GeometryBufferList |
container type used to hold GeometryBuffers created. | |
typedef std::map< String, OpenGLTexture *, StringFastLessCompare CEGUI_MAP_ALLOC(String, OpenGLTexture *)> | TextureMap |
container type used to hold Textures we create. | |
Protected Member Functions | |
OpenGLRendererBase (const Sizef &display_size) | |
Constructor. More... | |
OpenGLRendererBase (bool set_glew_experimental) | |
OpenGLRendererBase (const Sizef &display_size, bool set_glew_experimental) | |
Constructor. More... | |
void | init (bool init_glew=false, bool set_glew_experimental=false) |
virtual | ~OpenGLRendererBase () |
Destructor! | |
void | initialiseMaxTextureSize () |
helper to set (rough) max texture size. | |
void | initialiseDisplaySizeWithViewportSize () |
helper to set display size with current viewport size. | |
virtual OpenGLGeometryBufferBase * | createGeometryBuffer_impl ()=0 |
return some appropriate OpenGLGeometryBufferBase subclass instance. | |
virtual TextureTarget * | createTextureTarget_impl ()=0 |
return some appropriate TextureTarget subclass instance. | |
Static Protected Member Functions | |
static void | logTextureCreation (const String &name) |
helper to safely log the creation of a named texture | |
static void | logTextureDestruction (const String &name) |
helper to safely log the destruction of a named texture | |
Protected Attributes | |
Sizef | d_displaySize |
What the renderer considers to be the current display size. | |
Vector2f | d_displayDPI |
What the renderer considers to be the current display DPI resolution. | |
RenderTarget * | d_defaultTarget |
The default RenderTarget. | |
TextureTargetList | d_textureTargets |
Container used to track texture targets. | |
GeometryBufferList | d_geometryBuffers |
Container used to track geometry buffers. | |
TextureMap | d_textures |
Container used to track textures. | |
uint | d_maxTextureSize |
What the renderer thinks the max texture size is. | |
bool | d_initExtraStates |
option of whether to initialise extra states that may not be at default | |
BlendMode | d_activeBlendMode |
What blend mode we think is active. | |
mat4Pimpl * | d_viewProjectionMatrix |
View projection matrix. | |
RenderTarget * | d_activeRenderTarget |
The active RenderTarget. | |
Static Protected Attributes | |
static String | d_rendererID |
String holding the renderer identification text. | |
Common base class used for other OpenGL (desktop or ES) based renderer modules.
|
protected |
Constructor.
display_size | Size object describing the initial display resolution. |
|
protected |
Constructor.
display_size | Size object describing the initial display resolution. |
set_glew_experimental | If true, set "glewExperimental = GL_TRUE" before calling "glewInit". |
|
virtual |
Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from any RenderQueues and call destroyGeometryBuffer when you want to destroy the GeometryBuffer.
Implements CEGUI::Renderer.
Create a 'null' Texture object.
name | String holding the name for the new texture. Texture names must be unique within the Renderer. |
Implements CEGUI::Renderer.
|
virtual |
Create a Texture object using the given image file.
name | String holding the name for the new texture. Texture names must be unique within the Renderer. |
filename | String object that specifies the path and filename of the image file to use when creating the texture. |
resourceGroup | String objet that specifies the resource group identifier to be passed to the resource provider when loading the texture file filename. |
Implements CEGUI::Renderer.
|
virtual |
Create a Texture object with the given pixel dimensions as specified by size.
name | String holding the name for the new texture. Texture names must be unique within the Renderer. |
size | Size object that describes the desired texture size. |
Implements CEGUI::Renderer.
Texture& CEGUI::OpenGLRendererBase::createTexture | ( | const String & | name, |
GLuint | tex, | ||
const Sizef & | sz | ||
) |
Create a texture that uses an existing OpenGL texture with the specified size. Note that it is your responsibility to ensure that the OpenGL texture is valid and that the specified size is accurate.
sz | Size object that describes the pixel size of the OpenGL texture identified by tex. |
name | String holding the name for the new texture. Texture names must be unique within the Renderer. |
|
virtual |
Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose it's content from one frame to another.
If the renderer is unable to offer such a thing, 0 should be returned.
Implements CEGUI::Renderer.
|
virtual |
Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function. Before destroying any GeometryBuffer you should ensure that it has been removed from any RenderQueue that was using it.
buffer | The GeometryBuffer object to be destroyed. |
Implements CEGUI::Renderer.
|
virtual |
Destroy a Texture object that was previously created by calling the createTexture functions.
texture | Texture object to be destroyed. |
Implements CEGUI::Renderer.
|
virtual |
Destroy a Texture object that was previously created by calling the createTexture functions.
name | String holding the name of the texture to destroy. |
Implements CEGUI::Renderer.
|
virtual |
Function that cleans up TextureTarget objects created with the createTextureTarget function.
target | A pointer to a TextureTarget object that was previously returned from a call to createTextureTarget. |
Implements CEGUI::Renderer.
void CEGUI::OpenGLRendererBase::enableExtraStateSettings | ( | bool | setting | ) |
Tells the renderer to initialise some extra states beyond what it directly needs itself for CEGUI.
This option is useful in cases where you've made changes to the default OpenGL state and do not want to save/restore those between CEGUI rendering calls. Note that this option will not deal with every possible state or extension - if you want a state added here, make a request and we'll consider it ;)
RenderTarget* CEGUI::OpenGLRendererBase::getActiveRenderTarget | ( | ) |
Helper to get the active render target.
const CEGUI::Rectf& CEGUI::OpenGLRendererBase::getActiveViewPort | ( | ) |
Helper to get the viewport.
Helper to return a valid texture size according to reported OpenGL capabilities.
sz | Size object containing input size. |
Reimplemented in CEGUI::OpenGL3Renderer.
|
virtual |
Returns the default RenderTarget object. The default render target is is typically one that targets the entire screen (or rendering window).
Implements CEGUI::Renderer.
|
virtual |
Return the resolution of the display or host window in dots per inch.
Implements CEGUI::Renderer.
|
virtual |
Return the size of the display or host window in pixels.
Implements CEGUI::Renderer.
|
virtual |
Return identification string for the renderer module.
Implements CEGUI::Renderer.
|
virtual |
Return the pixel size of the maximum supported texture.
Implements CEGUI::Renderer.
Return a Texture object that was previously created by calling the createTexture functions.
Implements CEGUI::Renderer.
|
virtual |
Helper to return view projection matrix.
|
pure virtual |
Implemented in CEGUI::OpenGL3Renderer, and CEGUI::OpenGLRenderer.
|
inline |
Returns if the texture coordinate system is vertically flipped or not. The original of a texture coordinate system is typically located either at the the top-left or the bottom-left. CEGUI, Direct3D and most rendering engines assume it to be on the top-left. OpenGL assumes it to be at the bottom left.
This function is intended to be used when generating geometry for rendering the TextureTarget onto another surface. It is also intended to be used when trying to use a custom texture (RTT) inside CEGUI using the Image class, in order to determine the Image coordinates correctly.
void CEGUI::OpenGLRendererBase::setActiveRenderTarget | ( | RenderTarget * | renderTarget | ) |
Helper to set the active render target.
renderTarget | The active RenderTarget. |
|
virtual |
Set the size of the display or host window in pixels for this Renderer object.
This is intended to be called by the System as part of the notification process when display size changes are notified to it via the System::notifyDisplaySizeChanged function.
size | Size object describing the dimesions of the current or host window in pixels. |
Implements CEGUI::Renderer.
|
virtual |
Helper to set the view projection matrix.
viewProjectionMatrix | The view projection matrix. |
Reimplemented in CEGUI::OpenGLRenderer.