Crazy Eddies GUI System
0.6.0
|
Class that acts as a cache for images that need to be rendered. More...
Public Member Functions | |
RenderCache () | |
Constructor. | |
~RenderCache () | |
Destructor. | |
bool | hasCachedImagery () const |
Return whether the cache contains anything to draw. More... | |
void | render (const Point &basePos, float baseZ, const Rect &clipper) |
Send the contents of the cache to the Renderer. More... | |
void | clearCachedImagery () |
Erase any stored image information. | |
void | cacheImage (const Image &image, const Rect &destArea, float zOffset, const ColourRect &cols, const Rect *clipper=0, bool clipToDisplay=false) |
Add an image to the cache. More... | |
void | cacheText (const String &text, Font *font, TextFormatting format, const Rect &destArea, float zOffset, const ColourRect &cols, const Rect *clipper=0, bool clipToDisplay=false) |
Add a text to the cache. More... | |
Class that acts as a cache for images that need to be rendered.
This is in many ways an optimisation cache, it allows a full image redraw to occur while limiting the amount of information that needs to be re-calculated.
void CEGUI::RenderCache::cacheImage | ( | const Image & | image, |
const Rect & | destArea, | ||
float | zOffset, | ||
const ColourRect & | cols, | ||
const Rect * | clipper = 0 , |
||
bool | clipToDisplay = false |
||
) |
Add an image to the cache.
image | Image object to be cached. |
destArea | Destination area over which the Image object will be rendered. This area should be position independant; so position (0,0) will be to top-left corner of whatever it is you're rendering (like a Window for example). |
zOffset | Zero based z offset for this image. Allows imagery to be layered. |
cols | ColourRect object describing the colours to be applied when rendering this image. |
Referenced by CEGUI::FrameComponent::render_impl(), and CEGUI::ImageryComponent::render_impl().
void CEGUI::RenderCache::cacheText | ( | const String & | text, |
Font * | font, | ||
TextFormatting | format, | ||
const Rect & | destArea, | ||
float | zOffset, | ||
const ColourRect & | cols, | ||
const Rect * | clipper = 0 , |
||
bool | clipToDisplay = false |
||
) |
Add a text to the cache.
text | String object to be cached. |
font | Font to be used when rendering. |
format | TextFormatting value specifying the formatting to use when rendering. |
destArea | Destination area over which the Image object will be rendered. This area should be position independant; so position (0,0) will be to top-left corner of whatever it is you're rendering (like a Window for example). |
zOffset | Zero based z offset for this image. Allows imagery to be layered. |
cols | ColourRect object describing the colours to be applied when rendering this image. |
Referenced by CEGUI::TextComponent::render_impl().
bool CEGUI::RenderCache::hasCachedImagery | ( | ) | const |
Return whether the cache contains anything to draw.
Referenced by CEGUI::Window::drawSelf().
Send the contents of the cache to the Renderer.
basePos | Point that describes a screen offset that cached imagery will be rendered relative to. |
baseZ | Z value that cached imagery will use as a base figure when calculating final z values. |
clipper | Rect object describing a rect to which imagery will be clipped. |
References CEGUI::Rect::getIntersection(), CEGUI::System::getSingleton(), and CEGUI::Rect::offset().
Referenced by CEGUI::Window::drawSelf().