Original Post
I''ve been struggling for hours now and feel like I''m taking stupid-pills - for some reason my DirectX app has issues with regaining focus.
When I ALT-TAB out-and-into my full-screen application then I simply do not get the opportunity to Reset the DirectX(9) device.
I''ve tried all models I could think of to work this out. Finally I''ve even went for the "bare-bones" approach with the following code:
...
hr := DX9Device.Present(nil, nil, 0, nil);
if hr = D3DERR_DEVICELOST then begin
while DX9Device.TestCooperativeLevel <> D3DERR_DEVICENOTRESET do sleep(100);
DX9Device.Reset(present_parameters);
end;
...
No problems in windowed mode, but in fullscreen mode I end up with an infinite loop on the TestCooperativeLevel. The system simply isn''t willing to give me re-entry into the Device.
The SDK makes everything sound simple - and in sample codes I''ve looked at there isn''t any difficulty; it just doesn''t want to work for me...
Any ideas?
(I maintain a IDirect3DSurface9 to the BackBuffer - but it shouldn''t affect the problem, ditto for a ID3DXFont I''m using - though I''ve commented out all fonting just to be safe. There aren''t vertexbuffers or textures around that could give me grief - the graphics are created with manual pixel-manipulation.)
Help will be greatly appreciated...