Archived

This topic is now archived and is closed to further replies.

stefu

Why, why, why? Checking if fullscreen is minimized.

Recommended Posts

In fullscreen I press ALT-TAB. My WndProc should get WM_SIZE message and wParam should have SIZE_MAXHIDE or SIZE_MINIMIZED flag set. This works in OpenGL, but in Direct3D mode doesn''t. Why? I have same wndProc for both and create windows same way. Only difference is that Direct3D sets it displaymode, but I set Display mode for OpenGL using Win32 functions. Does D3D steal some WM_messages?

Share this post


Link to post
Share on other sites
You set the screenmode in OpenGL using Win32 functions...

...Therefore your OpenGL application is running in WINDOWED mode. DirectX will behave the same if you run it in windowed mode and use Win32 functions to change mode.

When you run DirectX in fullscreen **exclusive** mode it does slightly alter the behaviour of some although I don''t think I''ve ever noticed a WM_SIZE not being sent.

If you pass the correct flags to DirectX (ie. don''t disable task switching in SetCooperativeLevel etc) and don''t trap any of the NC* messages in your message loop Alt-Tab should be fine although some problems could be:

- Bad drivers - true fullscreen exclusive mode set by the driver is different to your "Windowed in a different display mode" - some video card drivers wrongly try to stop Alt-Tabs so messages may get lost.

- Bad handling of lost resources - WM_SIZE happens *after* the Alt-Tab has completed - if you aren''t restoring/resetting the device and using TestCooperativeLevel properly it may never get to the WM_SIZE stage!!!


Anyway I don''t see the problem - you have much more appropriate messages to use: WM_ACTIVATE and WM_ACTIVATEAPP

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Lol,

I totally forgot WM_ACTIVATE and others. I was just looking for d3dapp.cpp (from d3d8 sdk) and it used only WM_SIZE.

Thanks!

Now I also understand that OGL fs = windowed compared to D3D exclusive fs mode.

I was also wondering why did I see nothing after resetting the device but I forgot to set_render_states().
Not all works fine.

Share this post


Link to post
Share on other sites