Page 1 of 1

screen will be messed up when lost device?

Posted: Mon Mar 12, 2012 13:21
by heeroz
Hi,
I'm using:
cegui 0.7.5 (0.7.6 also has this problem)
ogre 1.7.4 with d3d9 render
Windows XP (this problem not show up in windows 7)

When ogre lost device:
19:56:18: !!! Direct3D Device successfully restored.
19:56:18: D3D9 device: 0x[0D,23A,860] was reset

Then i call CEGUI::System::getSingleton().notifyDisplaySizeChanged(sz) :
12/03/2,012 19:56:18 (Std) Display resize: w=951 h=548

Everything looks normal, but CEGUI::Windows's background will be messed up.
Screenshot:
Image
There is only a small piece wrong, But if your form is translucent, you will see the entire background is messed up.
Look like the bottom layer of the texture is not recovered from lost device.

When you move the mouse onto this form, the problem will gone.

I tried to perform the following code to fix:
CEGUI::System::getSingleton().getGUISheet()->invalidate(true);
but has no effect, background still messed up.

How do I solve this problem?
Thanks :)

Re: screen will be messed up when lost device?

Posted: Mon Mar 12, 2012 17:14
by Kulik
Try System::invalidateAllCachedRendering()

The areas that are corrupted are render textures.

http://www.cegui.org.uk/docs/current/cl ... f5de532e53

Re: screen will be messed up when lost device?

Posted: Tue Mar 13, 2012 09:04
by heeroz
Thanks for reply.

I found when the window size changed, OgreD3D9RenderSystem will reset the device after WndEvtListener::windowResized(CEGuiOgreBaseApplication.cpp) called.
So if you call notifyDisplaySizeChanged(or invalidateAllCachedRendering) in next frame , the problem will solved.