Original Post
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...