Crazy Eddies GUI System  0.6.2
CEGUIRenderer.h
1 /***********************************************************************
2  filename: CEGUIRenderer.h
3  created: 20/2/2004
4  author: Paul D Turner
5 
6  purpose: Defines interface for abstract Renderer class
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIRenderer_h_
31 #define _CEGUIRenderer_h_
32 
33 #include "CEGUIBase.h"
34 #include "CEGUIString.h"
35 #include "CEGUIRect.h"
36 #include "CEGUIColourRect.h"
37 #include "CEGUIEventSet.h"
38 
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
51 };
52 
58 {
61 };
62 
63 
72 class CEGUIEXPORT Renderer : public EventSet
73 {
74 public:
75  static const String EventNamespace;
76 
77  /*************************************************************************
78  Event name constants
79  *************************************************************************/
87 
88 
89  /*************************************************************************
90  Abstract interface methods
91  *************************************************************************/
117  virtual void addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode) = 0;
118 
119 
129  virtual void doRender(void) = 0;
130 
131 
139  virtual void clearRenderList(void) = 0;
140 
141 
157  virtual void setQueueingEnabled(bool setting) = 0;
158 
159 
168  virtual Texture* createTexture(void) = 0;
169 
170 
190  virtual Texture* createTexture(const String& filename, const String& resourceGroup) = 0;
191 
192 
208  virtual Texture* createTexture(float size) = 0;
209 
210 
221  virtual void destroyTexture(Texture* texture) = 0;
222 
223 
231  virtual void destroyAllTextures(void) = 0;
232 
233 
241  virtual bool isQueueingEnabled(void) const = 0;
242 
243 
251  virtual float getWidth(void) const = 0;
252 
253 
261  virtual float getHeight(void) const = 0;
262 
263 
271  virtual Size getSize(void) const = 0;
272 
273 
282  virtual Rect getRect(void) const = 0;
283 
284 
292  virtual uint getMaxTextureSize(void) const = 0;
293 
294 
302  virtual uint getHorzScreenDPI(void) const = 0;
303 
304 
312  virtual uint getVertScreenDPI(void) const = 0;
313 
314 
315  /*************************************************************************
316  Basic stuff we provide in base class
317  *************************************************************************/
325  void resetZValue(void) {d_current_z = GuiZInitialValue;}
326 
327 
335  void advanceZValue(void) {d_current_z -= GuiZElementStep;}
336 
337 
345  float getCurrentZ(void) const {return d_current_z;}
346 
347 
359  float getZLayer(uint layer) const {return d_current_z - ((float)layer * GuiZLayerStep);}
360 
361 
370  const String& getIdentifierString() const;
371 
372  virtual ResourceProvider* createResourceProvider(void);
373 
374 protected:
375  /*************************************************************************
376  Construction and Destruction
377  *************************************************************************/
378  Renderer(void);
379 
380 public: // for luabind support
381  virtual ~Renderer(void);
382 
383 private:
384  /*************************************************************************
385  Implementation constants
386  *************************************************************************/
387  static const float GuiZInitialValue;
388  static const float GuiZElementStep;
389  static const float GuiZLayerStep;
390 
391 
392  /*************************************************************************
393  Implementation Data
394  *************************************************************************/
395  float d_current_z;
396 
397 protected:
400 };
401 
402 } // End of CEGUI namespace section
403 
404 
405 #endif // end of guard _CEGUIRenderer_h_