Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
RendererModules/Null/Renderer.h
1 /***********************************************************************
2  created: Fri Jan 15 2010
3  author: Eugene Marcotte
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUINullRenderer_h_
28 #define _CEGUINullRenderer_h_
29 
30 #include "../../Renderer.h"
31 #include "../../Size.h"
32 #include "../../Vector.h"
33 
34 #include <vector>
35 #include <map>
36 
37 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
38 # ifdef CEGUINULLRENDERER_EXPORTS
39 # define NULL_GUIRENDERER_API __declspec(dllexport)
40 # else
41 # define NULL_GUIRENDERER_API __declspec(dllimport)
42 # endif
43 #else
44 # define NULL_GUIRENDERER_API
45 #endif
46 
47 #if defined(_MSC_VER)
48 # pragma warning(push)
49 # pragma warning(disable : 4251)
50 #endif
51 
52 
53 // Start of CEGUI namespace section
54 namespace CEGUI
55 {
56 class NullGeometryBuffer;
57 class NullTexture;
58 
60 class NULL_GUIRENDERER_API NullRenderer : public Renderer
61 {
62 public:
80  static NullRenderer& bootstrapSystem(const int abi = CEGUI_VERSION_ABI);
81 
97  static void destroySystem();
98 
103  static NullRenderer& create(const int abi = CEGUI_VERSION_ABI);
104 
106  static void destroy(NullRenderer& renderer);
107 
108  // implement CEGUI::Renderer interface
109  RenderTarget& getDefaultRenderTarget();
110  GeometryBuffer& createGeometryBuffer();
111  void destroyGeometryBuffer(const GeometryBuffer& buffer);
112  void destroyAllGeometryBuffers();
113  TextureTarget* createTextureTarget();
114  void destroyTextureTarget(TextureTarget* target);
115  void destroyAllTextureTargets();
116  Texture& createTexture(const String& name);
117  Texture& createTexture(const String& name,
118  const String& filename,
119  const String& resourceGroup);
120  Texture& createTexture(const String& name, const Sizef& size);
121  void destroyTexture(Texture& texture);
122  void destroyTexture(const String& name);
123  void destroyAllTextures();
124  Texture& getTexture(const String& name) const;
125  bool isTextureDefined(const String& name) const;
126  void beginRendering();
127  void endRendering();
128  void setDisplaySize(const Sizef& sz);
129  const Sizef& getDisplaySize() const;
130  const Vector2f& getDisplayDPI() const;
131  uint getMaxTextureSize() const;
132  const String& getIdentifierString() const;
133 
134 protected:
136  NullRenderer();
138  void constructor_impl();
140  virtual ~NullRenderer();
141 
143  void throwIfNameExists(const String& name) const;
145  static void logTextureCreation(const String& name);
147  static void logTextureDestruction(const String& name);
148 
158  typedef std::vector<TextureTarget*> TextureTargetList;
162  typedef std::vector<NullGeometryBuffer*> GeometryBufferList;
166  typedef std::map<String, NullTexture*, StringFastLessCompare
167  CEGUI_MAP_ALLOC(String, NullTexture*)> TextureMap;
172 };
173 
174 
175 } // End of CEGUI namespace section
176 
177 #if defined(_MSC_VER)
178 # pragma warning(pop)
179 #endif
180 
181 #endif // end of guard _CEGUINullRenderer_h_