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