rombust
10-07-2010, 07:14 AM
I have a question regarding the gui component constant repaint.
This is set using CL_GUIComponent::set_constant_repaint()
When enabled the GUI will constantly repaint this component when there are no other messages to process.
Internally, the GUI_Manager calls via the exec() calls: impl->invalidate_constant_repaint_components()
That function iterates recursively all components checking for the "CL_GUIComponent::get_constant_repaint()" flag.
If any child component contains the flag, the root component calls request_repaint()
The recent addition the clanGUI API adds: CL_GUIWindowManagerTexture::process() that updates the GUI.
But it does not check the constant_repaint flag of any components.
This was intentional at the time, but I am not sure is that is correct.
Some examples:
If you create an animating component using the GUI texture window manager, these are the possible methods.
...
CL_DisplayWindow window(desc);
...
CL_GUIWindowManagerTexture wm(window);
CL_GUIManager gui(wm, "../../../Resources/GUIThemeAero");
while (!quit)
{
Draw_The_Scene();
for each component
{
component->Animate();
if (component->FrameChanged())
component->request_repaint();
}
wm.process();
wm.draw_windows(gc);
window.flip(1);
CL_KeepAlive::process();
}
OR
...
CL_DisplayWindow window(desc);
...
CL_GUIWindowManagerTexture wm(window);
CL_GUIManager gui(wm, "../../../Resources/GUIThemeAero");
while (!quit)
{
Draw_The_Scene();
for each component
{
component->Animate();
component->set_constant_repaint(true);
}
wm.process(); // ** Will not work, because it does not look at the constant repaint flag
wm.draw_windows(gc);
window.flip(1);
CL_KeepAlive::process();
}
Should wm.process() check for constant repaint components automatically?
Or otherwise?
I do not know
This is set using CL_GUIComponent::set_constant_repaint()
When enabled the GUI will constantly repaint this component when there are no other messages to process.
Internally, the GUI_Manager calls via the exec() calls: impl->invalidate_constant_repaint_components()
That function iterates recursively all components checking for the "CL_GUIComponent::get_constant_repaint()" flag.
If any child component contains the flag, the root component calls request_repaint()
The recent addition the clanGUI API adds: CL_GUIWindowManagerTexture::process() that updates the GUI.
But it does not check the constant_repaint flag of any components.
This was intentional at the time, but I am not sure is that is correct.
Some examples:
If you create an animating component using the GUI texture window manager, these are the possible methods.
...
CL_DisplayWindow window(desc);
...
CL_GUIWindowManagerTexture wm(window);
CL_GUIManager gui(wm, "../../../Resources/GUIThemeAero");
while (!quit)
{
Draw_The_Scene();
for each component
{
component->Animate();
if (component->FrameChanged())
component->request_repaint();
}
wm.process();
wm.draw_windows(gc);
window.flip(1);
CL_KeepAlive::process();
}
OR
...
CL_DisplayWindow window(desc);
...
CL_GUIWindowManagerTexture wm(window);
CL_GUIManager gui(wm, "../../../Resources/GUIThemeAero");
while (!quit)
{
Draw_The_Scene();
for each component
{
component->Animate();
component->set_constant_repaint(true);
}
wm.process(); // ** Will not work, because it does not look at the constant repaint flag
wm.draw_windows(gc);
window.flip(1);
CL_KeepAlive::process();
}
Should wm.process() check for constant repaint components automatically?
Or otherwise?
I do not know