Game Development Community

Error occurs during transition to another resolution in full screen mode

by terrykim426 · in Torque Game Builder · 06/12/2012 (12:50 am) · 6 replies

Hi,

I'm using GetResolutionList() to retrieve all the available resolution setting for player to setup with.

In some specific resolution, this error msg, "The specified mode is not supported by this device." will occurs, during SetScreenMode() to set to a full screen.

After the error, the game would still be running in the background, but window itself was gone.

I noticed, its the function ChangeDisplaySettings() in winOGLVideo.cc that return a value of "DISP_CHANGE_BADMODE". I can't seems to find the ChangeDisplaySettings() and hence, I am not sure what causes it to return bad mode.

If anyone who know what's processing in the ChangeDisplaySettings(), please do tell me. Or if anyone can guide me on how to remove the unsupported resolutions from the getResolutionList(), it will be much appreciate as well.

Thanks =)

#1
06/28/2012 (7:15 pm)
Does anyone know anything about this? It has been 2 weeks since I last post for help, and I still can't get the problem to be resolved.
#2
06/29/2012 (12:00 pm)
I was doing a little searching and had VS C++ 2010 find out where that function was initialized and declared and this is the WHOLE function

ChangeDisplaySettingsW(
    __in_opt DEVMODEW* lpDevMode,
    __in DWORD dwFlags);

I was like "Wut?" but that's the only thing that VS can find on the subject.

The best I can piece together is ChangeDisplaySettings is some weird kind of variable initialized like "int num(5)" which is an odd but valid way of initializing and int called num. The documentation in that area of torque is extremely hazy. Have you tried something like the function "toggleFullScreen()". The documtation in the source code says this.
"() Use the toggleFullScreen function to switch from full-screen mode to windowed, or vice versa." "@return Returns true on success, false otherwise"
#3
06/29/2012 (12:27 pm)
Alpha-Kand, thanks for helping out!

I did tried using toggleFullScreen(), but I remember the same problem would still occur.

For the case on my office's PC, I have this resolution of 1960 x 1040. It work for windowed mode, but error will occur when its in full-screen mode. The resolution was provided from GetResolutionList().

Maybe I will try that again next Monday, as I do not have the project or the engine source code with me right now.
#4
07/10/2012 (1:29 pm)
ChangeDisplaySettings is a Windows function. There's more information about it on MSDN.

According to that, DISP_CHANGE_BADMODE is caused by the graphics mode not being supported. Which doesn't explain why they're showing up in the mode list, unfortunately.

What BPP are you setting it to when it fails?
#5
07/12/2012 (12:24 am)
Hi Kalle Wik,

Thanks for clearing up my confusion on the function!

I set it to 32BPP and it will failed. I never tried setting it to 16BPP before though.
#6
08/12/2012 (10:00 pm)
Has anyone else encountered the same problem as me? I still can't get it solved or do a roundabout from the problem.

I had tried using to ChangeDisplaySetting with the CDS_TEST flag right at the WinDisplayDevice::initDevice(), where the resolution list is setting up. The result was all return with a DISP_CHANGE_SUCCESSFUL, so I can't exclude the resolutions that are giving me the problem.