Ensure immediate canvas update inside GUI windows.
Ensure canvas displayed inside GUI windows are updated in the same frame as the according window is made visible. This prevents showing previous contents for the first frame.
This commit is contained in:
parent
0718e2b0f7
commit
07f01bd734
1 changed files with 11 additions and 0 deletions
|
@ -79,6 +79,17 @@ namespace canvas
|
|||
_capture_events = node->getBoolValue();
|
||||
else
|
||||
handled = false;
|
||||
|
||||
// Ensure canvas is redrawn before the window is displayed after it has
|
||||
// been hidden. We can't rely on the cull callback as it gets called too
|
||||
// late (GUI camera is attached as POST_RENDER whereas canvas contents are
|
||||
// rendered during PRE_RENDER).
|
||||
if( node->getNameString() == "visible" && node->getBoolValue() )
|
||||
{
|
||||
simgear::canvas::CanvasPtr canvas = getCanvas().lock();
|
||||
if( canvas )
|
||||
canvas->enableRendering();
|
||||
}
|
||||
}
|
||||
|
||||
if( !handled )
|
||||
|
|
Loading…
Add table
Reference in a new issue