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