Sign in to follow this  
Brother Erryn

DX9.0b DeviceLost Forever?

Recommended Posts

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....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Ok, I ran dbmon and get the following output:


124: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Attach: 0000007c, tid=0
0000524
124: Direct3D9: (WARN) :Executing processor detection code (benign first-chance
exception possible)
124:
124: Direct3D9: (INFO) :MMX detected
124:
124: Direct3D9: (INFO) :Pentium Pro CPU features (fcomi, cmov) detected
124:
124: Direct3D9: (INFO) :dwCPUFamily = 15, dwCPUFeatures = 3
124:
124: Direct3D9: (INFO) :szCPUString = GenuineIntel
124:
124: Direct3D9: :====> EXIT: DLLMAIN(08343950): Process Attach: 0000007c
124: Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
124: Direct3D9: (INFO) :======================= Hal HWVP Pure device selected
124:
124: Direct3D9: (INFO) :HalDevice Driver style 9
124:
124: Direct3D9: :Subclassing window 002403cc
124: Direct3D9: :StartExclusiveMode
124: 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=00000524

124: Direct3D9: :*** Active state changing
124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524
124: Direct3D9: :WM_DISPLAYCHANGE: 1024x768x16
124: D3DX: (INFO) Using SSE2 Instructions
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: (ERROR) :D3DFMT_UNKNOWN is not a valid format.
124: Direct3D9: :WM_SIZE hWnd=2403CC wp=0000, lp=03000400 dwFlags=00000001
124: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP
124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=0000007c, tid=00000524

124: Direct3D9: :*** Already activated
124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524
124: D3DX: Matrix should be 16-byte aligned for better performance
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 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=a00f0001
124: Direct3D9: :Hot key pressed, switching away from app
124: 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=000005
24
124: Direct3D9: :DoneExclusiveMode
124: Direct3D9: :INACTIVE: 0000007c: Restoring original mode (1280x1024x22x85) a
t adapter index 0
124: Direct3D9: :Window 00030642 is on top of us!!
124: Direct3D9: :Window 00130616 is on top of us!!
124: Direct3D9: :WM_DISPLAYCHANGE: 1280x1024x32
124: Direct3D9: :*** Active state changing
124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=0000052
4
124: Direct3D9: :WM_SYSKEYUP: wParam=00000012 lParam=c0380001
124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=000005
24
124: Direct3D9: :*** Already deactivated
124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=0000052
4
124: Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized
124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=000005
24
124: Direct3D9: :*** Already deactivated
124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=0000052
4
124: Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized
124: Direct3D9: :WM_SIZE hWnd=2403CC wp=0000, lp=03000400 dwFlags=00000001
124: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP
124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=0000007c, tid=00000524

124: Direct3D9: :*** Active state changing
124: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=0000007c, tid=00000524
124: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=0000007c, tid=000005
24
124: Direct3D9: :DoneExclusiveMode
124: Direct3D9: :*** Active state changing
124: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=0000007c, tid=0000052
4
124: Direct3D9: :*** WM_NCDESTROY unhooking window ***
124: Direct3D9: :*** Unhooking window proc
124: Direct3D9: :DoneExclusiveMode
124: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Detach 0000007c, tid=00
000524
124: 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?

Share this post


Link to post
Share on other sites
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 minimized
3976: Direct3D9: :WM_SIZE hWnd=440396 wp=0000, lp=03000400 dwFlags=00000001
3976: Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP
3976: Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=00000f88, tid=00000f8
4
3976: Direct3D9: :*** Active state changing
3976: Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=00000f88, tid=00000f84

3976: Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=00000f88, tid=00000
f84
3976: Direct3D9: :DoneExclusiveMode
3976: Direct3D9: :*** Active state changing
3976: Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=00000f88, tid=00000f
84
3976: Direct3D9: :*** WM_NCDESTROY unhooking window ***
3976: Direct3D9: :*** Unhooking window proc
3976: Direct3D9: :DoneExclusiveMode
3976: Direct3D9: :====> ENTER: DLLMAIN(08343950): Process Detach 00000f88, tid=0
0000f84
3976: Direct3D9: (INFO) :MemFini!
3976: Direct3D9: :====> EXIT: DLLMAIN(08343950): Process Detach 00000f88

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I tried waiting for DeviceLost to "end" again, still no go.

Is there something I could be doing strangely to my window? The SDK samples don't seem to have this problem. I also read something about needing to dispose of unmanaged objects before it will return the device, but I'm doing everything in the managed pool.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this