Jump to content
  • Advertisement
Sign in to follow this  
PranKe01

Changing the resolution

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

Hi there! I am writing an opengl program where I want to allow the user to change the resolution. In debug mode it works fine, but when I compile it in release mode, it does not change the resolution =( Here is my code: if(fullscreen){ DEVMODE dmScreenSettings; memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = width; dmScreenSettings.dmPelsHeight = height; dmScreenSettings.dmBitsPerPel = bits; dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; if(ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL){ fullscreen = false; }else{ SetWindowPos(hWnd, hWnd, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER); } }else{ SetWindowPos(hWnd, hWnd, 0, 0, width+i, height+j, SWP_NOMOVE | SWP_NOZORDER); } Does anyone got a solution for this problem? There are no warnings when I compile in release mode...

Share this post


Link to post
Share on other sites
Advertisement
What's the return value when it fails? Did you try checking EnumDisplaySettings() to make sure that the setting you're attempting is actually valid?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!