Jump to content
  • Advertisement
Sign in to follow this  

Task switching doesn't change window resolution

This topic is 3301 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've used the Windows OpenGL tutorial on Nehe to create my OpenGL window. The problem is that whenever I task switch (ALT + TAB) while my window is in fullscreen mode, the screen resolution does not change. Right now my application is in 640x480 mode and whenever I alt tab out, the resolution stays the same. Any ideas?

Share this post

Link to post
Share on other sites
You have to change back to desktop resolution yourself in your program.
That's not so easy I think, (I don't know which NEHE you are talking about, win32/glut?)
In win32 I think you have to do it in WM_ACTIVATE message somehow.

I use this code:
{ int _active,_minimized;

_active = LOWORD(wParam);
_minimized = (BOOL) HIWORD(wParam);

if (_active && !_minimized)
{ win_state.Active = true;
SetForegroundWindow( hWnd );
ShowWindow(hWnd, SW_RESTORE );

changeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN);//just like in your window creation
{ win_state.Active = false;

ChangeDisplaySettings(NULL,0);//I'm not sure about this one

return DefWindowProc(hWnd,uMsg,wParam,lParam);
I'm not sure it is the proper way.

Share this post

Link to post
Share on other sites
this is very slow.
Faster if you set the resolution with changeDisplaySettings(&dmDesktopSettings,CDS_FULLSCREEN);
in the else state too. You have to query the setting at startup of course.But how to do that?

EDIT: for example:
GetWindowRect(GetDesktopWindow(), &WindowRect);//RECT WindowRect

[Edited by - szecs on November 2, 2009 8:51:05 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!