Archived

This topic is now archived and is closed to further replies.

Sush

Crash when doing fullscreen ALT+TAB

Recommended Posts

Sush    122
Hi folks! I've got a really annoying problem which I am not able solve myself. I am almost as far to say that it might be a bug in the DirectX library or in the driver software but I don't have the experience to be sure. Would be nice if someone could tell me his/her opinion about that problem. Alright, actually I was working on my game when this problem occured. To find the "roots" of this error I wrote a simple application which displays only a single triangle. I was able to recreate the error with this programm. The problem is described quite quickly: When the programm runs (in fullscreen) and the user presses ALT + TAB, it crashes with an access violation. Please note that it crashes when Windows (WinXP on my machine) switches _from_ my application to desktop (or other processes) and not _to_ the application (so it can't have anything to do with "lost" resources like textures, etc). But I think it must have something to do with the D3DDevice which got lost due to a task change. I was able to track down the function that causes the access violation: It is the DrawPrimitive() method that is supposed to draw the triangle. But DXSDK-documentation says: "The application can continue to call rendering methods, such as IDirect3DDevice8::DrawPrimitive() [when device is in lost state...] Internally, these operations are discarded until the device is reset to the operational state." According to this it seems that it actually cannot be caused by the lost device. But I think it is somehow involved in that error because when I check for a "operational" device the crash can be avoided. Like this: if SUCCEEDED(pDev->TestCooperativeLevel()) pDev->DrawPrimitive(bla); Another thing I found out is that it only happens when I use untransformed vertices (without RHW component). Furthermore when the vertices are processed by hardware (with D3DCREATE_HARDWARE_VERTEXPROCESSING) the crash can be avoided. Taking everything together I found out that two conditions must be fulfilled in order to summon the access violation:
  • the (untransformed) vertices must be processed by software.
  • the device must have lost its operational status (which happens when doing ALT + TAB).
The crash happens when DrawPrimitive() is called and I think it actually happens during the translation work which DrawPrimitive() entails. But as I said I'm being far away from calling myself a DX guru. So I would appreciate your help. You can take a look at the sourcecode I use: View sourcecode I use WinXP home edition and a nVidia GeForce2 Pro. Thanks in advance. --Sush btw: If you don't understand something don't bother to ask... As I'm german I think there are several mistakes in english language Edited by - Sush on January 13, 2002 11:50:07 AM

Share this post


Link to post
Share on other sites