Skip to main content
gamedev.net
🔒 Locked

Changing the resolution

Started by PranKe01 Nov 28, 2008 at 8:52 AM 2 replies 700+ views
Original Post
PranKe01
PranKe01
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...
SiCrane
SiCrane
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?
PranKe01
PranKe01
When I run it in window mode SetWindowPos returns true! And it works good in debug mode oO
PranKe01
PranKe01
Does no one got an idea? =( If it could help, I would post more code...
Greets!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.