device lost after crtl-alt-del (Win XP)

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Kuzy
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

device lost after crtl-alt-del (Win XP)

Post by Kuzy »

Hello,

I'm rendering my irrlicht view into a form with direct3d9. Everytime the screensaver starts or I press crtl-alt-del to lock my computer, the irrlicht device gets lost and the rendering won't start again.
This behavior occurs with the irrlicht-examples as well (e.g. no.9 mesh viewer).

Does anybody have a hint for me to prevent this behavior? Maybe check the visibility of the form before rendering?

Thanks
Kuzy
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: device lost after crtl-alt-del (Win XP)

Post by hybrid »

The device reset should work, though, and re-initialise everything properly. Don't know if we have had a missing reset case still in 1.7, for sure there were problems in earlier versions. But at least with latest SVN/trunk the device came up for me without problems again.
Kuzy
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: device lost after crtl-alt-del (Win XP)

Post by Kuzy »

Thanks hybrid.

If I generate a new device, irrlicht runs again.
But at the same time i have to create a new screenmanager and to recreate my models...
Is there an more easy way just to restart the device without deleting all my data?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: device lost after crtl-alt-del (Win XP)

Post by hybrid »

The device reset happens automatically. The console will log about it. Please tell us your Irrlicht version, or maybe directly send the full console log.
Kuzy
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: device lost after crtl-alt-del (Win XP)

Post by Kuzy »

Hello hybrid,

here's my console log:

Irrlicht Engine version 1.7.2
Microsoft Windows XP Professional Service Pack 3 (Build 2600)
Using renderer: Direct3D 9.0
...
Present failed: DIRECT3D9 device lost.
Resetting failed due to invalid call: You need to release some more surfaces.

I am running irrlicht in a win32-Form and I was wrong: The examples of irrlicht work fine, even when I press crtl-alt-del.

Yesterday I checked the behaviour with the newest svn/trunk. My app is still not working with that.
If I choose the openGL driver the device reset is working, but other things don't. So that's no alternative for me.

Do you have any hint for me, how i can get the resetting work again?

Thanks in advance
Kuzy
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: device lost after crtl-alt-del (Win XP)

Post by hybrid »

Well, since you do the surface handling on your own, you have to release and re-create the main surface and depth buffer etc. on your own. You can check via the return value of beginScene if a reset happened. In that case you have to release everything from D3D (all surfaces etc.) and do the reset. I guess you can simply call beginScene again. After that, recreate all surfaces and make sure your context is complete again. Then start the render process all over again. At least that might work in theory. But I'm not sure if all render calls are prepared for this stuff. I fear that there will be some work in front of you, extending the engine to cope with such situations. We're open to integrate these things into the engine, though, so please tell us about your results.
Kuzy
Posts: 21
Joined: Fri Feb 18, 2011 10:30 am

Re: device lost after crtl-alt-del (Win XP)

Post by Kuzy »

Hello Hybrid,

I found a strange solution for my problem, but it works :-)
My render loop is written in c# and is running in a separate thread, which I started via

Code: Select all

 
RenderThread = new Thread(new ThreadStart(renderLoop));
RenderThread.Start();
 
For reasons I don't know, the rendering breaks down when I press ctrl-alt-del in this case.

If I start my rendering thread inside the form-class by

Code: Select all

 
delegate void renderLoopDeleg();
public void renderThreadInvoker()
{
    this.BeginInvoke(new renderLoopDeleg(renderLoop));
}
 
everything works ok...

Thanks for your support anyway.
Kuzy
Post Reply