Jump to content
  • Advertisement
Sign in to follow this  
Sigvatr

Task switching doesn't change window resolution

This topic is 3128 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
Advertisement
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:
case WM_ACTIVATE:
{ 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
}
else
{ win_state.Active = false;
ShowWindow(hWnd,SW_MINIMIZE);


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
ChangeDisplaySettings(NULL,0);
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!