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)
120 static OgreRenderer& bootstrapSystem(
const int abi = CEGUI_VERSION_ABI);
146 static OgreRenderer& bootstrapSystem(Ogre::RenderTarget& target,
147 const int abi = CEGUI_VERSION_ABI);
165 static void destroySystem();
167 #if !defined(CEGUI_USE_OGRE_COMPOSITOR2)
178 static OgreRenderer& create(
const int abi = CEGUI_VERSION_ABI);
187 const int abi = CEGUI_VERSION_ABI);
205 void setRenderingEnabled(
const bool enabled);
208 bool isRenderingEnabled()
const;
227 Texture& createTexture(
const String& name, Ogre::TexturePtr& tex,
228 bool take_ownership =
false);
231 void setupRenderingBlendMode(
const BlendMode mode,
232 const bool force =
false);
251 void setFrameControlExecutionEnabled(
const bool enabled);
270 bool isFrameControlExecutionEnabled()
const;
280 void initialiseRenderStateSettings();
291 void setDefaultRootRenderTarget(Ogre::RenderTarget& target);
302 bool isUsingShaders()
const;
322 void setUsingShaders(
const bool use_shaders);
342 void updateShaderParams()
const;
345 void setWorldMatrix(
const Ogre::Matrix4& m);
347 void setViewMatrix(
const Ogre::Matrix4& m);
349 void setProjectionMatrix(
const Ogre::Matrix4& m);
351 const Ogre::Matrix4& getWorldMatrix()
const;
353 const Ogre::Matrix4& getViewMatrix()
const;
355 const Ogre::Matrix4& getProjectionMatrix()
const;
367 const Ogre::Matrix4& getWorldViewProjMatrix()
const;
386 #ifdef CEGUI_USE_OGRE_HLMS
387 Ogre::RenderTarget* getOgreRenderTarget();
388 const Ogre::HlmsSamplerblock* getHlmsSamplerblock();
395 void destroyAllGeometryBuffers();
398 void destroyAllTextureTargets();
402 const String& resourceGroup);
404 void destroyTexture(
Texture& texture);
405 void destroyTexture(
const String& name);
406 void destroyAllTextures();
408 bool isTextureDefined(
const String& name)
const;
409 void beginRendering();
411 void setDisplaySize(
const Sizef& sz);
412 const Sizef& getDisplaySize()
const;
413 const Vector2f& getDisplayDPI()
const;
414 uint getMaxTextureSize()
const;
415 const String& getIdentifierString()
const;
426 void checkOgreInitialised();
428 void throwIfNameExists(
const String& name)
const;
430 static void logTextureCreation(
const String& name);
432 static void logTextureDestruction(
const String& name);
435 void constructor_impl(Ogre::RenderTarget& target);
437 void initialiseShaders();
439 void cleanupShaders();
448 #if defined(_MSC_VER)
449 # pragma warning(pop)
452 #endif // end of guard _CEGUIOgreRenderer_h_