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
00027
00028
00029
00030 #ifndef _CEGUIRenderer_h_
00031 #define _CEGUIRenderer_h_
00032
00033 #include "CEGUIBase.h"
00034 #include "CEGUIString.h"
00035 #include "CEGUIRect.h"
00036 #include "CEGUIColourRect.h"
00037 #include "CEGUIEventSet.h"
00038
00039
00040
00041 namespace CEGUI
00042 {
00047 enum OrientationFlags {
00048 FlipHorizontal = 1,
00049 FlipVertical = 2,
00050 RotateRightAngle = 4
00051 };
00052
00057 enum QuadSplitMode
00058 {
00059 TopLeftToBottomRight,
00060 BottomLeftToTopRight
00061 };
00062
00063
00072 class CEGUIEXPORT Renderer : public EventSet
00073 {
00074 public:
00075 static const String EventNamespace;
00076
00077
00078
00079
00086 static const String EventDisplaySizeChanged;
00087
00088
00089
00090
00091
00117 virtual void addQuad(const Rect& dest_rect, float z, const Texture* tex, const Rect& texture_rect, const ColourRect& colours, QuadSplitMode quad_split_mode) = 0;
00118
00119
00129 virtual void doRender(void) = 0;
00130
00131
00139 virtual void clearRenderList(void) = 0;
00140
00141
00157 virtual void setQueueingEnabled(bool setting) = 0;
00158
00159
00168 virtual Texture* createTexture(void) = 0;
00169
00170
00190 virtual Texture* createTexture(const String& filename, const String& resourceGroup) = 0;
00191
00192
00208 virtual Texture* createTexture(float size) = 0;
00209
00210
00221 virtual void destroyTexture(Texture* texture) = 0;
00222
00223
00231 virtual void destroyAllTextures(void) = 0;
00232
00233
00241 virtual bool isQueueingEnabled(void) const = 0;
00242
00243
00251 virtual float getWidth(void) const = 0;
00252
00253
00261 virtual float getHeight(void) const = 0;
00262
00263
00271 virtual Size getSize(void) const = 0;
00272
00273
00282 virtual Rect getRect(void) const = 0;
00283
00284
00292 virtual uint getMaxTextureSize(void) const = 0;
00293
00294
00302 virtual uint getHorzScreenDPI(void) const = 0;
00303
00304
00312 virtual uint getVertScreenDPI(void) const = 0;
00313
00314
00315
00316
00317
00325 void resetZValue(void) {d_current_z = GuiZInitialValue;}
00326
00327
00335 void advanceZValue(void) {d_current_z -= GuiZElementStep;}
00336
00337
00345 float getCurrentZ(void) const {return d_current_z;}
00346
00347
00359 float getZLayer(uint layer) const {return d_current_z - ((float)layer * GuiZLayerStep);}
00360
00361
00370 const String& getIdentifierString() const;
00371
00372 virtual ResourceProvider* createResourceProvider(void);
00373
00374 protected:
00375
00376
00377
00378 Renderer(void);
00379
00380 public:
00381 virtual ~Renderer(void);
00382
00383 private:
00384
00385
00386
00387 static const float GuiZInitialValue;
00388 static const float GuiZElementStep;
00389 static const float GuiZLayerStep;
00390
00391
00392
00393
00394
00395 float d_current_z;
00396
00397 protected:
00398 ResourceProvider* d_resourceProvider;
00399 String d_identifierString;
00400 };
00401
00402 }
00403
00404
00405 #endif // end of guard _CEGUIRenderer_h_