Crazy Eddies GUI System  0.7.0
CEGUIIrrlichtRenderer.h
1 /***********************************************************************
2  filename: CEGUIIrrlichtRenderer.h
3  created: Tue Mar 3 2009
4  author: Paul D Turner (parts based on original code by Thomas Suter)
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2009 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 _CEGUIIrrlichtRenderer_h_
29 #define _CEGUIIrrlichtRenderer_h_
30 
31 #include "CEGUIIrrlichtRendererDef.h"
32 #include "../../CEGUIRenderer.h"
33 #include "../../CEGUISize.h"
34 #include "../../CEGUIVector.h"
35 
36 #include <vector>
37 
38 #if defined(_MSC_VER)
39 # pragma warning(push)
40 # pragma warning(disable : 4251)
41 #endif
42 
43 // forward reference irrlicht classes
44 namespace irr
45 {
46 class IrrlichtDevice;
47 struct SEvent;
48 
49 namespace video
50 {
51 class IVideoDriver;
52 }
53 
54 namespace io
55 {
56 class IFileSystem;
57 }
58 
59 }
60 
61 // Start of CEGUI namespace section
62 namespace CEGUI
63 {
64 class IrrlichtTexture;
65 class IrrlichtGeometryBuffer;
66 class IrrlichtResourceProvider;
67 class IrrlichtEventPusher;
68 class IrrlichtImageCodec;
69 
71 class IRR_GUIRENDERER_API IrrlichtRenderer : public Renderer
72 {
73 public:
92  static IrrlichtRenderer& bootstrapSystem(irr::IrrlichtDevice& device);
93 
110  static void destroySystem();
111 
113  static IrrlichtRenderer& create(irr::IrrlichtDevice& device);
114 
116  static void destroy(IrrlichtRenderer& renderer);
117 
120  createIrrlichtResourceProvider(irr::io::IFileSystem& fs);
121 
123  static void destroyIrrlichtResourceProvider(IrrlichtResourceProvider& rp);
124 
126  static IrrlichtImageCodec& createIrrlichtImageCodec(
127  irr::video::IVideoDriver& driver);
128 
130  static void destroyIrrlichtImageCodec(IrrlichtImageCodec& ic);
131 
133  bool injectEvent(const irr::SEvent& event);
134 
135  // implement Renderer interface
136  RenderingRoot& getDefaultRenderingRoot();
137  GeometryBuffer& createGeometryBuffer();
138  void destroyGeometryBuffer(const GeometryBuffer& buffer);
139  void destroyAllGeometryBuffers();
140  TextureTarget* createTextureTarget();
141  void destroyTextureTarget(TextureTarget* target);
142  void destroyAllTextureTargets();
143  Texture& createTexture();
144  Texture& createTexture(const String& filename, const String& resourceGroup);
145  Texture& createTexture(const Size& size);
146  void destroyTexture(Texture& texture);
147  void destroyAllTextures();
148  void beginRendering();
149  void endRendering();
150  void setDisplaySize(const Size& sz);
151  const Size& getDisplaySize() const;
152  const Vector2& getDisplayDPI() const;
153  uint getMaxTextureSize() const;
154  const String& getIdentifierString() const;
155 
156 protected:
158  IrrlichtRenderer(irr::IrrlichtDevice& device);
160  ~IrrlichtRenderer();
161 
165  irr::IrrlichtDevice& d_device;
167  irr::video::IVideoDriver* d_driver;
177  typedef std::vector<TextureTarget*> TextureTargetList;
181  typedef std::vector<IrrlichtGeometryBuffer*> GeometryBufferList;
185  typedef std::vector<IrrlichtTexture*> TextureList;
192 
193 };
194 
195 } // End of CEGUI namespace section
196 
197 #if defined(_MSC_VER)
198 # pragma warning(pop)
199 #endif
200 
201 #endif // end of guard _CEGUIIrrlichtRenderer_h_