00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CEGUIRenderer_h_
00027 #define _CEGUIRenderer_h_
00028
00029 #include "CEGUIBase.h"
00030 #include "CEGUIString.h"
00031 #include "CEGUIRect.h"
00032 #include "CEGUIColourRect.h"
00033 #include "CEGUIEventSet.h"
00034
00035
00036
00037 namespace CEGUI
00038 {
00043 enum OrientationFlags {
00044 FlipHorizontal = 1,
00045 FlipVertical = 2,
00046 RotateRightAngle = 4
00047 };
00048
00053 enum QuadSplitMode
00054 {
00055 TopLeftToBottomRight,
00056 BottomLeftToTopRight
00057 };
00058
00059
00068 class CEGUIEXPORT Renderer : public EventSet
00069 {
00070 public:
00071 static const String EventNamespace;
00072
00073
00074
00075
00082 static const String EventDisplaySizeChanged;
00083
00084
00085
00086
00087
00113 virtual void addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode) = 0;
00114
00115
00125 virtual void doRender(void) = 0;
00126
00127
00135 virtual void clearRenderList(void) = 0;
00136
00137
00153 virtual void setQueueingEnabled(bool setting) = 0;
00154
00155
00164 virtual Texture* createTexture(void) = 0;
00165
00166
00186 virtual Texture* createTexture(const String& filename, const String& resourceGroup) = 0;
00187
00188
00204 virtual Texture* createTexture(float size) = 0;
00205
00206
00217 virtual void destroyTexture(Texture* texture) = 0;
00218
00219
00227 virtual void destroyAllTextures(void) = 0;
00228
00229
00237 virtual bool isQueueingEnabled(void) const = 0;
00238
00239
00247 virtual float getWidth(void) const = 0;
00248
00249
00257 virtual float getHeight(void) const = 0;
00258
00259
00267 virtual Size getSize(void) const = 0;
00268
00269
00278 virtual Rect getRect(void) const = 0;
00279
00280
00288 virtual uint getMaxTextureSize(void) const = 0;
00289
00290
00298 virtual uint getHorzScreenDPI(void) const = 0;
00299
00300
00308 virtual uint getVertScreenDPI(void) const = 0;
00309
00310
00311
00312
00313
00321 void resetZValue(void) {d_current_z = GuiZInitialValue;}
00322
00323
00331 void advanceZValue(void) {d_current_z -= GuiZElementStep;}
00332
00333
00341 float getCurrentZ(void) const {return d_current_z;}
00342
00343
00355 float getZLayer(uint layer) const {return d_current_z - ((float)layer * GuiZLayerStep);}
00356
00357
00366 const String& getIdentifierString() const;
00367
00368 virtual ResourceProvider* createResourceProvider(void);
00369
00370 protected:
00371
00372
00373
00374 Renderer(void);
00375
00376 public:
00377 virtual ~Renderer(void);
00378
00379 private:
00380
00381
00382
00383 static const float GuiZInitialValue;
00384 static const float GuiZElementStep;
00385 static const float GuiZLayerStep;
00386
00387
00388
00389
00390
00391 float d_current_z;
00392
00393 protected:
00394 ResourceProvider* d_resourceProvider;
00395 String d_identifierString;
00396 };
00397
00398 }
00399
00400
00401 #endif // end of guard _CEGUIRenderer_h_