I'm using CEGUI with Ogre and just tried to port to the 0.7.0 version of CEGUI. As I have read so far there are some changes to the "'inner rect' fixes made for 0.7.0". As I don't run the SVN version for now, maybe this might be solved when switching to it.
My bigger problem appears when I resize my application window. With the 0.7 version and the new renderer model 2.0 I need to get CEGUI to redraw all windows. The only way I get this done now is by iterating through the window tree and change the size slightly. But this resizing takes about 15 seconds (a complete app hang)...
Code: Select all
void TV3D_GUI::resizeChildWindows( CEGUI::Window* pkWindow )
{
if( pkWindow )
{
CEGUI::UVector2 vec( CEGUI::UDim( 1.0f, 0 ), CEGUI::UDim( 1.0f, 0 ) );
vec = pkWindow->getSize();
vec += CEGUI::UVector2( CEGUI::UDim( 0.0f, 0.0001f ), CEGUI::UDim( 0.0f, 0.0001f ) );
pkWindow->setSize( vec );
for( int nChildIndex = 0; nChildIndex < pkWindow->getChildCount(); nChildIndex++ )
{
resizeChildWindows( pkWindow->getChildAtIdx( nChildIndex ) );
}
}
}
I have already tried other solutions like:
Code: Select all
pkWindow->getRenderingSurface()->invalidate();
or
Code: Select all
pkWindow->getGeometryBuffer()->reset();
but none of them seems to have an effect.
Can someone tell me what I am doing wrong?
Cheers, Ben
Some more detailed info. This is what Ogre does:
!!! Direct3D Device Lost!
Releasing D3D9 default pool texture: Video3
Released D3D9 default pool texture: Video3
... Releasing a lot of stuff ...
D3D9TextureManager released:
16 unmanaged textures
D3D9HardwareBufferManager released:
794 unmanaged vertex buffers
0 unmanaged index buffers
Reset device ok w:905 h:794
D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at low
er frame rates, turn VSync on if you observe this problem.
Recreating D3D9 default pool texture: Video3
Recreated D3D9 default pool texture: Video3
... Recreating a lot of stuff ...
D3D9TextureManager recreated:
16 unmanaged textures
D3D9HardwareBufferManager recreated:
794 unmanaged vertex buffers
0 unmanaged index buffers
!!! Direct3D Device successfully restored.
This is how the GUI looks after the first start. The window content is moved from the tilebar and outer window frame. After moving the window once this gets fixed:
This is how the GUI looks after resizing and doing nothing (in fact I have done two mouse clicks to see something at all...):
This is how the GUI looks (and how it finally should look like) after resizing and using the setSize code from above (with 15 seconds delay!):