Crazy Eddie's GUI System
0.8.7
|
27 #ifndef _CEGUIOgreRenderer_h_
28 #define _CEGUIOgreRenderer_h_
30 #include "../../Renderer.h"
31 #include "../../Size.h"
32 #include "../../Vector.h"
33 #include "CEGUI/Config.h"
37 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
38 # ifdef CEGUIOGRERENDERER_EXPORTS
39 # define OGRE_GUIRENDERER_API __declspec(dllexport)
41 # define OGRE_GUIRENDERER_API __declspec(dllimport)
44 # define OGRE_GUIRENDERER_API
48 # pragma warning(push)
49 # pragma warning(disable : 4251)
57 #if (CEGUI_OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
60 template<
typename T>
class SharedPtr;
62 typedef SharedPtr<Texture> TexturePtr;
67 #if (CEGUI_OGRE_VERSION >= (2 << 16))
70 #define CEGUI_USE_OGRE_COMPOSITOR2
73 #if (CEGUI_OGRE_VERSION >= ((2 << 16) | (1 << 8) | 0))
75 #define CEGUI_USE_OGRE_HLMS
76 #include <OgreRenderOperation.h>
77 #include <OgreHlmsSamplerblock.h>
83 class OgreGeometryBuffer;
85 class OgreResourceProvider;
87 class OgreWindowTarget;
88 struct OgreRenderer_impl;
94 #if !defined(CEGUI_USE_OGRE_COMPOSITOR2)
147 const int abi = CEGUI_VERSION_ABI);
167 #if !defined(CEGUI_USE_OGRE_COMPOSITOR2)
187 const int abi = CEGUI_VERSION_ABI);
228 bool take_ownership =
false);
232 const bool force =
false);
386 #ifdef CEGUI_USE_OGRE_HLMS
387 Ogre::RenderTarget* getOgreRenderTarget();
388 const Ogre::HlmsSamplerblock* getHlmsSamplerblock();
402 const String& resourceGroup);
448 #if defined(_MSC_VER)
449 # pragma warning(pop)
452 #endif // end of guard _CEGUIOgreRenderer_h_
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
void setWorldMatrix(const Ogre::Matrix4 &m)
Set the current world matrix to the given matrix.
OgreRenderer()
default constructor.
TextureTarget * createTextureTarget()
Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose i...
static void logTextureDestruction(const String &name)
helper to safely log the destruction of a named texture
static void destroyOgreImageCodec(OgreImageCodec &ic)
function to destroy a CEGUI::OgreImageCodec object.
static OgreRenderer & bootstrapSystem(const int abi=CEGUI_VERSION_ABI)
Convenience function that creates all the Ogre specific objects and then initialises the CEGUI system...
uint getMaxTextureSize() const
Return the pixel size of the maximum supported texture.
void destroyTextureTarget(TextureTarget *target)
Function that cleans up TextureTarget objects created with the createTextureTarget function.
Definition: RendererModules/Ogre/ResourceProvider.h:39
CEGUI::Renderer implementation for the Ogre engine.
Definition: RendererModules/Ogre/Renderer.h:92
void destroyAllGeometryBuffers()
Destroy all GeometryBuffer objects created by this Renderer.
void beginRendering()
Perform any operations required to put the system into a state ready for rendering operations to begi...
const Ogre::Matrix4 & getWorldMatrix() const
return a const reference to the current world matrix.
void initialiseShaders()
helper that creates and sets up shaders
static OgreRenderer & create(Ogre::RenderTarget &target, const int abi=CEGUI_VERSION_ABI)
Create an OgreRenderer object that uses the specified Ogre::RenderTarget as the default output surfac...
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
void checkOgreInitialised()
checks Ogre initialisation. throws exceptions if an issue is detected.
void updateShaderParams() const
Updates the shader constant parameters (i.e. uniforms).
bool isTexCoordSystemFlipped() const
Returns if the texture coordinate system is vertically flipped or not. The original of a texture coor...
Definition: RendererModules/Ogre/Renderer.h:384
Texture & createTexture(const String &name, Ogre::TexturePtr &tex, bool take_ownership=false)
Create a CEGUI::Texture that wraps an existing Ogre texture.
void setDefaultRootRenderTarget(Ogre::RenderTarget &target)
Sets the Ogre::RenderTarget that should be targetted by the default GUIContext.
OgreRenderer_impl * d_pimpl
Pointer to the hidden implementation data.
Definition: RendererModules/Ogre/Renderer.h:442
static void logTextureCreation(const String &name)
helper to safely log the creation of a named texture
bool isUsingShaders() const
Returns whether the OgreRenderer is currently set to use shaders when doing its rendering operations.
const Ogre::Matrix4 & getWorldViewProjMatrix() const
Return a const reference to the final transformation matrix that should be used when transforming geo...
void destroyGeometryBuffer(const GeometryBuffer &buffer)
Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function....
static void destroySystem()
Convenience function to cleanup the CEGUI system and related objects that were created by calling the...
void setViewMatrix(const Ogre::Matrix4 &m)
Set the current view matrix to the given matrix.
Texture & createTexture(const String &name, const Sizef &size)
Create a Texture object with the given pixel dimensions as specified by size.
static OgreRenderer & create(const int abi=CEGUI_VERSION_ABI)
Create an OgreRenderer object that uses the default Ogre rendering window as the default output surfa...
const String & getIdentifierString() const
Return identification string for the renderer module.
void setProjectionMatrix(const Ogre::Matrix4 &m)
Set the current projection matrix to the given matrix.
virtual ~OgreRenderer()
destructor.
const Vector2f & getDisplayDPI() const
Return the resolution of the display or host window in dots per inch.
Texture & createTexture(const String &name)
Create a 'null' Texture object.
void initialiseRenderStateSettings()
Sets all the required render states needed for CEGUI rendering.
static OgreRenderer & bootstrapSystem(Ogre::RenderTarget &target, const int abi=CEGUI_VERSION_ABI)
Convenience function that creates all the Ogre specific objects and then initialises the CEGUI system...
const Ogre::Matrix4 & getProjectionMatrix() const
return a const reference to the current projection matrix.
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
void cleanupShaders()
helper to clean up shaders
bool isRenderingEnabled() const
return whether CEGUI rendering is enabled.
void throwIfNameExists(const String &name) const
helper to throw exception if name is already used.
void constructor_impl(Ogre::RenderTarget &target)
common parts of constructor
static OgreImageCodec & createOgreImageCodec()
function to create a CEGUI::OgreImageCodec object.
Texture & createTexture(const String &name, const String &filename, const String &resourceGroup)
Create a Texture object using the given image file.
static void destroyOgreResourceProvider(OgreResourceProvider &rp)
function to destroy a CEGUI::OgreResourceProvider object
BlendMode
Enumerated type that contains the valid options that specify the type of blending that is to be perfo...
Definition: Renderer.h:62
const Sizef & getDisplaySize() const
Return the size of the display or host window in pixels.
static OgreResourceProvider & createOgreResourceProvider()
function to create a CEGUI::OgreResourceProvider object
static void destroy(OgreRenderer &renderer)
destory an OgreRenderer object.
const Ogre::Matrix4 & getViewMatrix() const
return a const reference to the current view matrix.
bool isTextureDefined(const String &name) const
Return whether a texture with the given name exists.
OgreRenderer(Ogre::RenderTarget &target)
constructor takin the Ogre::RenderTarget to use as the default root.
bool isFrameControlExecutionEnabled() const
Returns whether rendering done by CEGUI will be wrapped with calls to Ogre::RenderSystem::_beginFrame...
Defines interface to some surface that can be rendered to. Concrete instances of objects that impleme...
Definition: RenderTarget.h:60
void endRendering()
Perform any operations required to finalise rendering.
void bindShaders()
Perform required operations to bind shaders (or unbind them) depending on whether shader based render...
RenderTarget & getDefaultRenderTarget()
Returns the default RenderTarget object. The default render target is is typically one that targets t...
GeometryBuffer & createGeometryBuffer()
Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from a...
void destroyTexture(const String &name)
Destroy a Texture object that was previously created by calling the createTexture functions.
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:41
String class used within the GUI system.
Definition: String.h:64
void setupRenderingBlendMode(const BlendMode mode, const bool force=false)
set the render states for the specified BlendMode.
void destroyAllTextures()
Destroy all Texture objects created by this Renderer.
void setUsingShaders(const bool use_shaders)
Set whether the OgreRenderer shound use shaders when performing its rendering operations.
void setDisplaySize(const Sizef &sz)
Set the size of the display or host window in pixels for this Renderer object.
void destroyTexture(Texture &texture)
Destroy a Texture object that was previously created by calling the createTexture functions.
ImageCodec object that loads data via image loading facilities in Ogre.
Definition: RendererModules/Ogre/ImageCodec.h:41
Abstract class defining the basic required interface for Renderer objects.
Definition: Renderer.h:84
Texture & getTexture(const String &name) const
Return a Texture object that was previously created by calling the createTexture functions.
void destroyAllTextureTargets()
Destory all TextureTarget objects created by this Renderer.
void setRenderingEnabled(const bool enabled)
set whether CEGUI rendering will occur
void setFrameControlExecutionEnabled(const bool enabled)
Controls whether rendering done by CEGUI will be wrapped with calls to Ogre::RenderSystem::_beginFram...