Discussion:
DirectX application problem
(too old to reply)
John Heaney
2006-05-10 19:07:55 UTC
Permalink
I recently wrote my first Windows application. I used DirectX because it
is not a standard window-based application. It's more like a game
interface and performance is an issue. I used the fullscreen, exclusive
mode. Anyway, all went well, but I have one problem. If the user
switches to another application using Alt-Tab and then comes back to the
application, the screen remains black. I can't get it to refresh. The
application is still functioning correctly, I just can't draw anything.

Any suggestions will be greatly appreciated.
--
John S. Heaney
I don't train in Aikido to protect myself from the world,
but to protect the world from me.
Kellie Fitton
2006-05-12 22:17:16 UTC
Permalink
Hi,

Since the video mode have changed with task switching Alt+Tab,
you need to call Restore() on each of your surfaces, including
front buffer, back buffers and in-memory surfaces, most of the
DirectDraw video game samples handles the following Windows
message to restore all surfaces upon task switching:

WM_ACTIVATEAPP

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowmessages/wm_activateapp.asp

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/vbddref_486a.asp

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/vbddref_01r6.asp

Hope these suggestions helps,

Kellie.
John Heaney
2006-05-13 02:53:51 UTC
Permalink
Post by Kellie Fitton
Hi,
Since the video mode have changed with task switching Alt+Tab,
you need to call Restore() on each of your surfaces, including
front buffer, back buffers and in-memory surfaces, most of the
DirectDraw video game samples handles the following Windows
WM_ACTIVATEAPP
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/w
indowsuserinterface/windowing/windows/windowreference/windowmessages/wm_activa
teapp.asp
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/direct
draw7/vbddref_486a.asp
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/direct
draw7/vbddref_01r6.asp
Hope these suggestions helps,
Kellie.
Fantastic! I'll try that first chance I get. Thank you.
--
John S. Heaney
I don't train in Aikido to protect myself from the world,
but to protect the world from me.
Continue reading on narkive:
Loading...