Crazy Eddies GUI System 0.7.5

CEGUINullRenderer.h

00001 /***********************************************************************
00002     filename:   CEGUINullRenderer.h
00003     created:    Fri Jan 15 2010
00004     author:     Eugene Marcotte
00005 *************************************************************************/
00006 /***************************************************************************
00007  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
00008  *
00009  *   Permission is hereby granted, free of charge, to any person obtaining
00010  *   a copy of this software and associated documentation files (the
00011  *   "Software"), to deal in the Software without restriction, including
00012  *   without limitation the rights to use, copy, modify, merge, publish,
00013  *   distribute, sublicense, and/or sell copies of the Software, and to
00014  *   permit persons to whom the Software is furnished to do so, subject to
00015  *   the following conditions:
00016  *
00017  *   The above copyright notice and this permission notice shall be
00018  *   included in all copies or substantial portions of the Software.
00019  *
00020  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00021  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00024  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00025  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00026  *   OTHER DEALINGS IN THE SOFTWARE.
00027  ***************************************************************************/
00028 #ifndef _CEGUINullRenderer_h_
00029 #define _CEGUINullRenderer_h_
00030 
00031 #include "../../CEGUIRenderer.h"
00032 #include "../../CEGUISize.h"
00033 #include "../../CEGUIVector.h"
00034 
00035 #include <vector>
00036 #include <map>
00037 
00038 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
00039 #   ifdef NULL_GUIRENDERER_EXPORTS
00040 #       define NULL_GUIRENDERER_API __declspec(dllexport)
00041 #   else
00042 #       define NULL_GUIRENDERER_API __declspec(dllimport)
00043 #   endif
00044 #else
00045 #   define NULL_GUIRENDERER_API
00046 #endif
00047 
00048 #if defined(_MSC_VER)
00049 #   pragma warning(push)
00050 #   pragma warning(disable : 4251)
00051 #endif
00052 
00053 
00054 // Start of CEGUI namespace section
00055 namespace CEGUI
00056 {
00057 class NullGeometryBuffer;
00058 class NullTexture;
00059 class NullRenderTarget;
00060 
00062 class NULL_GUIRENDERER_API NullRenderer : public Renderer
00063 {
00064 public:
00079     static NullRenderer& bootstrapSystem();
00080     
00096     static void destroySystem();
00097 
00102     static NullRenderer& create();
00103 
00105     static void destroy(NullRenderer& renderer);
00106 
00107     // implement CEGUI::Renderer interface
00108     RenderingRoot& getDefaultRenderingRoot();
00109     GeometryBuffer& createGeometryBuffer();
00110     void destroyGeometryBuffer(const GeometryBuffer& buffer);
00111     void destroyAllGeometryBuffers();
00112     TextureTarget* createTextureTarget();
00113     void destroyTextureTarget(TextureTarget* target);
00114     void destroyAllTextureTargets();
00115     Texture& createTexture();
00116     Texture& createTexture(const String& filename, const String& resourceGroup);
00117     Texture& createTexture(const Size& size);
00118     void destroyTexture(Texture& texture);
00119     void destroyAllTextures();
00120     void beginRendering();
00121     void endRendering();
00122     void setDisplaySize(const Size& sz);
00123     const Size& getDisplaySize() const;
00124     const Vector2& getDisplayDPI() const;
00125     uint getMaxTextureSize() const;
00126     const String& getIdentifierString() const;
00127 
00128 protected:
00130     NullRenderer();
00132         void constructor_impl();
00134     virtual ~NullRenderer();
00135 
00137     static String d_rendererID;
00139     Size d_displaySize;
00141     Vector2 d_displayDPI;
00143     RenderingRoot* d_defaultRoot;
00145     NullRenderTarget* d_defaultTarget;
00147     typedef std::vector<TextureTarget*> TextureTargetList;
00149     TextureTargetList d_textureTargets;
00151     typedef std::vector<NullGeometryBuffer*> GeometryBufferList;
00153     GeometryBufferList d_geometryBuffers;
00155     typedef std::vector<NullTexture*> TextureList;
00157     TextureList d_textures;
00159     uint d_maxTextureSize;
00160 };
00161 
00162 
00163 } // End of  CEGUI namespace section
00164 
00165 #if defined(_MSC_VER)
00166 #   pragma warning(pop)
00167 #endif
00168 
00169 #endif  // end of guard _CEGUINullRenderer_h_