29 #ifndef _CEGUIWindowRendererManager_h_
30 #define _CEGUIWindowRendererManager_h_
32 #include "CEGUI/Singleton.h"
33 #include "CEGUI/WindowRenderer.h"
34 #include "CEGUI/Logger.h"
35 #include "CEGUI/Exceptions.h"
36 #include "CEGUI/TplWindowRendererFactory.h"
41 # pragma warning(push)
42 # pragma warning(disable : 4251)
48 class CEGUIEXPORT WindowRendererManager :
49 public Singleton<WindowRendererManager>,
50 public AllocatedObject<WindowRendererManager>
56 WindowRendererManager();
57 ~WindowRendererManager();
62 static WindowRendererManager& getSingleton();
63 static WindowRendererManager* getSingletonPtr();
68 bool isFactoryPresent(
const String& name)
const;
69 WindowRendererFactory* getFactory(
const String& name)
const;
88 static void addFactory();
104 template <
typename T>
105 static void addWindowRendererType();
107 void addFactory(WindowRendererFactory* wr);
108 void removeFactory(
const String& name);
113 WindowRenderer* createWindowRenderer(
const String& name);
114 void destroyWindowRenderer(WindowRenderer* wr);
124 typedef std::map<String, WindowRendererFactory*, StringFastLessCompare> WR_Registry;
128 typedef std::vector<WindowRendererFactory*
129 CEGUI_VECTOR_ALLOC(WindowRendererFactory*)> OwnedFactoryList;
131 static OwnedFactoryList d_ownedFactories;
135 template <
typename T>
139 WindowRendererFactory* factory = CEGUI_NEW_AO T;
142 if (WindowRendererManager::getSingletonPtr())
144 Logger::getSingleton().logEvent(
"Created WindowRendererFactory for '" +
146 "' WindowRenderers.");
150 WindowRendererManager::getSingleton().addFactory(factory);
152 CEGUI_CATCH (Exception&)
154 Logger::getSingleton().logEvent(
"Deleted WindowRendererFactory for "
155 "'" + factory->getName() +
156 "' WindowRenderers.");
158 CEGUI_DELETE_AO factory;
163 d_ownedFactories.push_back(factory);
167 template <
typename T>
170 WindowRendererManager::addFactory<TplWindowRendererFactory<T> >();
178 #if defined(_MSC_VER)
179 # pragma warning(pop)
182 #endif // _CEGUIWindowRendererManager_h_
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
static void addFactory()
Creates a WindowRendererFactory of the type T and adds it to the system for use.
Definition: cegui/include/CEGUI/WindowRendererManager.h:136
static void addWindowRendererType()
Internally creates a factory suitable for creating WindowRenderer objects of the given type and adds ...
Definition: cegui/include/CEGUI/WindowRendererManager.h:168