00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _CEGUIRenderCache_h_
00025 #define _CEGUIRenderCache_h_
00026
00027 #include "CEGUIVector.h"
00028 #include "CEGUIRect.h"
00029 #include "CEGUIImage.h"
00030 #include "CEGUIFont.h"
00031 #include <vector>
00032
00033
00034 #if defined(_MSC_VER)
00035 # pragma warning(push)
00036 # pragma warning(disable : 4251)
00037 #endif
00038
00039
00040
00041 namespace CEGUI
00042 {
00059 class CEGUIEXPORT RenderCache
00060 {
00061 public:
00066 RenderCache();
00067
00072 ~RenderCache();
00073
00082 bool hasCachedImagery() const;
00083
00100 void render(const Point& basePos, float baseZ, const Rect& clipper) const;
00101
00106 void clearCachedImagery();
00107
00129 void cacheImage(const Image& image, const Rect& destArea, float zOffset, const ColourRect& cols, const Rect* clipper = 0, bool clipToDisplay = false);
00130
00158 void cacheText(const String& text, const Font* font, TextFormatting format, const Rect& destArea, float zOffset, const ColourRect& cols, const Rect* clipper = 0, bool clipToDisplay = false);
00159
00160 private:
00165 struct ImageInfo
00166 {
00167 const Image* source_image;
00168 Rect target_area;
00169 float z_offset;
00170 ColourRect colours;
00171 Rect customClipper;
00172 bool usingCustomClipper;
00173 bool clipToDisplay;
00174 };
00175
00180 struct TextInfo
00181 {
00182 String text;
00183 const Font* source_font;
00184 TextFormatting formatting;
00185 Rect target_area;
00186 float z_offset;
00187 ColourRect colours;
00188 Rect customClipper;
00189 bool usingCustomClipper;
00190 bool clipToDisplay;
00191 };
00192
00193 typedef std::vector<ImageInfo> ImageryList;
00194 typedef std::vector<TextInfo> TextList;
00195
00196 ImageryList d_cachedImages;
00197 TextList d_cachedTexts;
00198 };
00199
00200 }
00201
00202
00203 #if defined(_MSC_VER)
00204 # pragma warning(pop)
00205 #endif
00206
00207
00208 #endif // end of guard _CEGUIRenderCache_h_