I have an application that creates a Direct3D 9 device in fullscreen mode and then starts presenting. At a later point, after having created the first device, I temporarily create a new Direct3D device in windowed mode (on the same thread but for a different window). I destroy this device immediately again, but somehow I'm then no longer able to Alt-tab out of the fullscreen application anymore. The application just stays on top rather than dropping to the background although it looks like the application is no longer in focus.
If I create my temporary device as D3DDEVTYPE_NULLREF, I'm suddenly able to Alt-tab out. Does anybody have an idea why that is, and if so, how I can create a second temporary device without messing up the existing device?
When you create a D3D device you specify which window do bind it to (third parameter of
CreateDevice
call). I may suggest that destroying of second device takes out focus in a way which is unseen by the first device. Try explicitly returning the focus back to main window:Btw, if this is how you make parallel rendering consider using render targets or swap chains instead. DX9 docs say that switching between devices puts a significant penalty to performance.