ChangeDisplaySettings(&dm,0) chokes on 95

ChangeDisplaySettings(&dm,0) freezes-up the screen with artifacts when trying to return from fullscreen mode. This only happens in Windows 95. It works fine in all other versions of Windows.

A Google search shows that many people have encountered this problem, but the only sort of solution they give is to mix DX and OpenGL. Is there any other workaround or preferred method of doing fullscreen on Windows 95?

You should use ChangeDisplaySettings(NULL,0); to return to the default mode.
From the MSDN

LONG ChangeDisplaySettings(
LPDEVMODE lpDevMode, // graphics mode
DWORD dwflags // graphics mode options
);

lpDevMode
[in] Pointer to a DEVMODE structure that describes the new graphics mode. If lpDevMode is NULL, all the values currently in the registry will be used for the display setting. Passing NULL for the lpDevMode parameter and 0 for the dwFlags parameter is the easiest way to return to the default mode after a dynamic mode change.

Either way it crashes. It crashes regardless of what the first parameter is. Try it (on a Windows 95 machine).

The MSDN mentions the fact that on older Windows systems (95/98/ME), it is better to call ChangeDisplaySettings in a thread that does not have a window, because of messaging issues. Otherwise it can screw the icons. I doubt this is related to your problem, but you might want to give it a try.

Have you tried to narrow your problem down to be 100% sure of its cause? Eg ChangeDisplaySettings(your settings), wait a little (do nothing, not even create a window or anything), ChangeDisplaySettings(NULL,0). Does it still crash? Do you use CDS_TEST before actually switching? Does it happen on other Win95 systems?

If it turns out to be a driver problem, I guess you would pretty much have to live with it. I doubt you will find support for Win95-related problems. I mean, we’re close to 2005. Win95 has to be the most buggy OS of the past decade. Everybody remember the blue screen nightmares that popped every few minutes, and I think nobody want to develop anything on it anymore. If you are concerned with older machines, I think putting Win98 as a minimum requirement is not a silly thing to do. Doom3 requires Win 2000 or Win XP.

I think it’s an nVidia bug. It happens to me on 98se. Not only my own code, but in other people’s code, and in commericial games.

When switching back from another fullscreen mode, sometimes the screen becomes a garbled mess of things that used to be in vram. And it’s stuck that way until a reboot.

Had the same problem with ATI, but finally found a solution:

Make a copy of the original dm right after starting the app then use the copy of the original dm when finished.

P.S. OpenGL.org should keep postings available for more than a year, so the next poor slob that has this problem does not have to spend weeks Googling around in circles and trying things!

Originally posted by asdf asdf:
[b]Had the same problem with ATI, but finally found a solution:

Make a copy of the original dm right after starting the app then use the copy of the original dm when finished.

P.S. OpenGL.org should keep postings available for more than a year, so the next poor slob that has this problem does not have to spend weeks Googling around in circles and trying things![/b]
DEVMODE structure you mean?

Yes, not NULL.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.