Anyway, basically we clear and reset the cursor image - this is nasty, and I think I'll expose a currently private function that re-caches the geometry used for the mouse cursor instead. Once this is done, we iterate over all windows invalidating the window's cached geometry and also the cached geometry used for RenderingWindows (i.e. those controlled via AutoRenderingSurface). If you have any 'free' GeometryBuffers, then it's up to you to refresh those at an appropriate time, if you don't know what I mean by that, you don't have any and will not have to worry.
Anyway, if you can give this a whirl and let me know your opinion as to the first question above, that would be good
Code: Select all
CEGUI::MouseCursor& mouse(CEGUI::MouseCursor::getSingleton());
const CEGUI::Image* const img = mouse.getImage();
mouse.setImage(0);
mouse.setImage(img);
CEGUI::WindowManager::WindowIterator wi(CEGUI::WindowManager::getSingleton().getIterator());
for ( ; !wi.isAtEnd(); ++wi)
{
CEGUI::Window* const wnd(wi.getCurrentValue());
wnd->invalidate();
CEGUI::RenderingSurface* rs;
if ((rs = wnd->getRenderingSurface()) && rs->isRenderingWindow())
static_cast<CEGUI::RenderingWindow*>(rs)->invalidateGeometry();
}
CE
PS. We use this exact same code within CEGUI for when the display is resized - so an alternate hack would be to notify the display size as zero and then back to the 'real' size. It's shorter but IMO a lot more nasty