28 #ifndef _CEGUIOgreRenderer_h_
29 #define _CEGUIOgreRenderer_h_
31 #include "../../Renderer.h"
32 #include "../../Size.h"
33 #include "../../Vector.h"
34 #include "CEGUI/Config.h"
38 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
39 # ifdef CEGUIOGRERENDERER_EXPORTS
40 # define OGRE_GUIRENDERER_API __declspec(dllexport)
42 # define OGRE_GUIRENDERER_API __declspec(dllimport)
45 # define OGRE_GUIRENDERER_API
49 # pragma warning(push)
50 # pragma warning(disable : 4251)
58 #if (CEGUI_OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
61 template<
typename T>
class SharedPtr;
63 typedef SharedPtr<Texture> TexturePtr;
71 class OgreGeometryBuffer;
73 class OgreResourceProvider;
75 class OgreWindowTarget;
76 struct OgreRenderer_impl;
107 static OgreRenderer& bootstrapSystem(
const int abi = CEGUI_VERSION_ABI);
133 static OgreRenderer& bootstrapSystem(Ogre::RenderTarget& target,
134 const int abi = CEGUI_VERSION_ABI);
152 static void destroySystem();
164 static OgreRenderer& create(
const int abi = CEGUI_VERSION_ABI);
172 const int abi = CEGUI_VERSION_ABI);
190 void setRenderingEnabled(
const bool enabled);
193 bool isRenderingEnabled()
const;
212 Texture& createTexture(
const String& name, Ogre::TexturePtr& tex,
213 bool take_ownership =
false);
216 void setupRenderingBlendMode(
const BlendMode mode,
217 const bool force =
false);
236 void setFrameControlExecutionEnabled(
const bool enabled);
255 bool isFrameControlExecutionEnabled()
const;
265 void initialiseRenderStateSettings();
276 void setDefaultRootRenderTarget(Ogre::RenderTarget& target);
287 bool isUsingShaders()
const;
307 void setUsingShaders(
const bool use_shaders);
327 void updateShaderParams()
const;
330 void setWorldMatrix(
const Ogre::Matrix4& m);
332 void setViewMatrix(
const Ogre::Matrix4& m);
334 void setProjectionMatrix(
const Ogre::Matrix4& m);
336 const Ogre::Matrix4& getWorldMatrix()
const;
338 const Ogre::Matrix4& getViewMatrix()
const;
340 const Ogre::Matrix4& getProjectionMatrix()
const;
352 const Ogre::Matrix4& getWorldViewProjMatrix()
const;
358 void destroyAllGeometryBuffers();
361 void destroyAllTextureTargets();
365 const String& resourceGroup);
367 void destroyTexture(
Texture& texture);
368 void destroyTexture(
const String& name);
369 void destroyAllTextures();
371 bool isTextureDefined(
const String& name)
const;
372 void beginRendering();
374 void setDisplaySize(
const Sizef& sz);
375 const Sizef& getDisplaySize()
const;
376 const Vector2f& getDisplayDPI()
const;
377 uint getMaxTextureSize()
const;
378 const String& getIdentifierString()
const;
389 void checkOgreInitialised();
391 void throwIfNameExists(
const String& name)
const;
393 static void logTextureCreation(
const String& name);
395 static void logTextureDestruction(
const String& name);
398 void constructor_impl(Ogre::RenderTarget& target);
400 void initialiseShaders();
402 void cleanupShaders();
411 #if defined(_MSC_VER)
412 # pragma warning(pop)
415 #endif // end of guard _CEGUIOgreRenderer_h_