Animated GUI
Posted: Wed Aug 10, 2005 14:15
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 ?
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 ?