Hi,
This is the first time I use CEGUI (with OGRE as the 3D engine). Recently I stumbled accross a problem and I wanted to share how I solved it and then ask a question.
Well my designer wanted that in the application we have a mimic of the windows taskbar for our windows. So I implemented several news widgets (Taskbar, TaskbarButton and an extended FrameWindows with minimize button) into my own custom look.
Everything was ok but then I needed to implement the minimize effect. So I went through de documentation and did not see any mechanism to ask for a refresh each frame except the requestRedraw call. I added then the requestRedraw in my drawing code but it was doing nothing. I gave a look at the CEGUI code and saw that (in the CEGUISystem.cpp file):
[font=Courier]
if (d_gui_redraw)
{
d_renderer->resetZValue();
d_renderer->setQueueingEnabled(true);
d_renderer->clearRenderList();
if (d_activeSheet != NULL)
{
d_activeSheet->render();
}
d_gui_redraw = false;
}
[/font]
Ok I see the problem, I change to this
[font=Courier]
if (d_gui_redraw)
{
d_gui_redraw = false; // this is the moved line
d_renderer->resetZValue();
d_renderer->setQueueingEnabled(true);
d_renderer->clearRenderList();
if (d_activeSheet != NULL)
{
d_activeSheet->render();
}
}
[/font]
Basically the redraw flag was resetted at the end of the drawing and not before we draw everything (that's why requestRedraw from a draw was without effect).
My question is to know if there was a reason why it was only resetted at the end ? Or is it just that nobody was silly enough to request a redraw in the draw code ?
Animated GUI
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Animated GUI
Whirly wrote:
Or is it just that nobody was silly enough to request a redraw in the draw code ?
Yes, that's it exactly
This is something that should not have any ill effects for anyone, so this should get updated to allow the behaviour you describe (that is, clearing the flag first).
Hi, while trying to implement drawing animated button (anim on top) i faced the same issue. Note that im using CeGUI#, but the code fragment in c# is a twin. Funy to realize that nobody ever tried RequestRedraw
Anyway, note that it is still not changed in CEGUI svn. Please, change!
fiee: CEGUISystem.cpp line:359
Anyway, note that it is still not changed in CEGUI svn. Please, change!
fiee: CEGUISystem.cpp line:359
Return to “CEGUI Library Development Discussion”
Who is online
Users browsing this forum: No registered users and 4 guests