Jump to content
  • Advertisement
Sign in to follow this  
joanusdmentia

OpenGL Fullscreen on secondary display

This topic is 4392 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

This is more a Win32 question, but it is API specific and it isn't D3D so I figured this would be the best place for it. I was recently given an LCD monitor for my b'day, so instead of throwing out my CRT (which while not great, is still decent enough) I've now got a dual-monitor setup and loving it. I've never had this before, so all of my OpenGL projects aren't multi-monitor aware so I thought I'd fire one up and see what happens. It opens up the window, I move it to the second monitor and switch to fullscreen mode.....my primary monitor changes resolution. Not entirely surprising, but how do I get it to change the resolution of my second monitor (ie. the monitor the window is on). I can find out which monitor it's on with MonitorFromWindow() and with GetMonitorInfo() and the MONITORINFOEX structure I can get the device name, but passing this to ChangeDisplaySettings() doesn't make any difference. Has anyone done this with OpenGL/Win32? I don't have any OpenGL games installed at the moment, but my D3D games run on the second monitor just fine.

Share this post


Link to post
Share on other sites
Advertisement
Did you use ChangeDisplaySettings() or ChangeDisplaySettingsEx(), as the latter seems to be the key as you can supply a device name and other info for the swap with it.

Share this post


Link to post
Share on other sites
Hmm...now my desktop icons keep getting repositioned, despite me using the CDS_FULLSCREEN flag. The MSDN docs mention this can happen on Win95/98/ME and that doing the resolution change in a thread without any windows should fix it. I'm running WinXP SP2 so this shouldn't be a problem anyway, but I tried the separate thread without any luck.

Any ideas how to fix this?

Share this post


Link to post
Share on other sites
Quote:
Original post by joanusdmentia
Hmm...now my desktop icons keep getting repositioned, despite me using the CDS_FULLSCREEN flag. The MSDN docs mention this can happen on Win95/98/ME and that doing the resolution change in a thread without any windows should fix it. I'm running WinXP SP2 so this shouldn't be a problem anyway, but I tried the separate thread without any luck.

Any ideas how to fix this?


manually save the icon positions thru the desktop com interface..

you must be doing something wrong i guess, or this may be a bug in XP as well, i saw some fullscreen games reset my icon positions as well.

Share this post


Link to post
Share on other sites
Quote:
Original post by Delfi
manually save the icon positions thru the desktop com interface..

you must be doing something wrong i guess, or this may be a bug in XP as well, i saw some fullscreen games reset my icon positions as well.


I was hoping there'd be a better way, but I've now got this mostly working by finding the ListView control that contains the desktop icons and getting & setting the icon positions on fullscreen mode changes. The only problem now is that when restoring the icons I have to put in an arbitrary delay to ensure the desktop has been updated with the new resolution, otherwise some icons end up in the wrong position (since the desktop size hasn't been updated). Is there a way to know when the desktop has been updated, or will I just have to make sure I wait long enough for it to usually work? Under high loads there's no guarenttee that whatever number I pick will be a long enough delay, without getting stupidly long that is.

Share this post


Link to post
Share on other sites
Hmm, I've manage to find another problem where if the desktop background is changed and then the program run, the background gets reset to the previous image. This all seems to be stemming from the use of ChangeDisplaySettingsEx(), using ChangeDisplaySettings() gets rid of both the icon and background image problems. Of course, then I can only use the primary display.

I'm starting a new thread for this, since it's really a different topic.

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!