DX9.0b DeviceLost Forever?

Started by
10 comments, last by Brother Erryn 19 years, 8 months ago
My device never leaves the state of DeviceLost after ALT-TABbing out of it in full screen mode. I am cancelling the DeviceResizing event for full-screen mode, all resources are in the managed pool, and windowed mode works like a charm, resizing and all. The SDK samples work properly, much to my chagrin. As near as I can see, I'm handling full-screen mode identically. I'm completely stumped, and am not even sure what code to post as part of this question. Can somebody try to steer me in the right direction? Three days of this makes Homer something something....
Advertisement
Are you using the Debug Runtime? (See the Forum FAQ for details)

If so, does it say anything useful?
Stay Casual,KenDrunken Hyena
I'd love to...but I can't enabled Unmanaged Code Debugging (which I understand is necessary to get anything out of the debug runtime). The perils of only owning the Standard Edition, I suppose. I do have the debug runtime installed and active, not that it helps in this case.
You can use the dbmon.exe utility (provided with the SDK) to observe debug output, in the case that your IDE of choice cannot display it for some reason.

Niko Suni

Oooo....I'll do that once I get home to the code, thanks! I knew there was a reason I posted my question here. :)

I'll post again later once I've done that and/or figured out anything.
Ok, I ran dbmon and get the following output:

124: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Attach: 0000007c, tid=00000524124: Direct3D9: (WARN) :Executing processor detection code (benign first-chanceexception possible)124:124: Direct3D9: (INFO) :MMX detected124:124: Direct3D9: (INFO) :Pentium Pro CPU features (fcomi, cmov) detected124:124: Direct3D9: (INFO) :dwCPUFamily = 15, dwCPUFeatures = 3124:124: Direct3D9: (INFO) :szCPUString = GenuineIntel124:124: Direct3D9: :====> EXIT: DLLMAIN(08343950): Process Attach: 0000007c124: Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.124: Direct3D9: (INFO) :======================= Hal HWVP Pure device selected124:124: Direct3D9: (INFO) :HalDevice Driver style 9124:124: Direct3D9: :Subclassing window 002403cc124: Direct3D9: :StartExclusiveMode124: Direct3D9: :Window 00030066 is on top of us!!124: Direct3D9: :Window 00030066 is on top of us!!124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=0000007c, tid=00000524124: Direct3D9: :*** Active state changing124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524124: Direct3D9: :WM_DISPLAYCHANGE: 1024x768x16124: D3DX: (INFO) Using SSE2 Instructions124: Direct3D9: (ERROR) :D3DFMT_UNKNOWN is not a valid format.124: Direct3D9: (ERROR) :D3DFMT_UNKNOWN is not a valid format.124: Direct3D9: (ERROR) :D3DFMT_UNKNOWN is not a valid format.124: Direct3D9: (ERROR) :D3DFMT_UNKNOWN is not a valid format.124: Direct3D9: (ERROR) :D3DFMT_UNKNOWN is not a valid format.124: Direct3D9: :WM_SIZE hWnd=2403CC wp=0000, lp=03000400 dwFlags=00000001124: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=0000007c, tid=00000524124: Direct3D9: :*** Already activated124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524124: D3DX: Matrix should be 16-byte aligned for better performance124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00130616 is on top of us!!124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00130616 is on top of us!!124: Direct3D9: :WM_SYSKEYUP: wParam=00000009 lParam=a00f0001124: Direct3D9: :Hot key pressed, switching away from app124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00130616 is on top of us!!124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :DoneExclusiveMode124: Direct3D9: :INACTIVE: 0000007c: Restoring original mode (1280x1024x22x85) at adapter index 0124: Direct3D9: :Window 00030642 is on top of us!!124: Direct3D9: :Window 00130616 is on top of us!!124: Direct3D9: :WM_DISPLAYCHANGE: 1280x1024x32124: Direct3D9: :*** Active state changing124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :WM_SYSKEYUP: wParam=00000012 lParam=c0380001124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :*** Already deactivated124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :*** Already deactivated124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized124: Direct3D9: :WM_SIZE hWnd=2403CC wp=0000, lp=03000400 dwFlags=00000001124: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=0000007c, tid=00000524124: Direct3D9: :*** Active state changing124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :DoneExclusiveMode124: Direct3D9: :*** Active state changing124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=00000524124: Direct3D9: :*** WM_NCDESTROY unhooking window ***124: Direct3D9: :*** Unhooking window proc124: Direct3D9: :DoneExclusiveMode124: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Detach 0000007c, tid=00000524124: Direct3D9: (INFO) :MemFini!124: Direct3D9: :====> EXIT: DLLMAIN(08343950): Process Detach 0000007c


Not that I can read the spew very well, but it looks like the application is activated, switches to full screen and runs, and does fine through returning to the desktop...but then nothing else until it's destroyed. No other events seem to fire. Am I reading this wrong?
If it helps, here's what I'm getting after ALT-TABbing out (running dbmon, then attempting to restore):

3976: Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized3976: Direct3D9: :WM_SIZE hWnd=440396 wp=0000, lp=03000400 dwFlags=000000013976: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP3976: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00000f88, tid=00000f843976: Direct3D9: :*** Active state changing3976: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00000f88, tid=00000f843976: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=00000f88, tid=00000f843976: Direct3D9: :DoneExclusiveMode3976: Direct3D9: :*** Active state changing3976: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=00000f88, tid=00000f843976: Direct3D9: :*** WM_NCDESTROY unhooking window ***3976: Direct3D9: :*** Unhooking window proc3976: Direct3D9: :DoneExclusiveMode3976: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Detach 00000f88, tid=00000f843976: Direct3D9: (INFO) :MemFini!3976: Direct3D9: :====> EXIT: DLLMAIN(08343950): Process Detach 00000f88
I ended up copying/pasting the render loop code from one of the SDK samples, so that I would have the same sequence of TestCooperativeLevel, Begin(), End(), rendering, etc...no difference. I hope somebody can toss me a bone on this one.
I don't use anything too complicated:

  while(p_Device->TestCooperativeLevel() == D3DERR_DEVICELOST)  {    Sleep(1000);  }


If its lost, wait a sec, and try again.
Tried that....the loop never ends. TestCooperativeLevel always tests as DeviceLost after ALT-TABbing out.

This topic is closed to new replies.

Advertisement