Fullscreen switching

Started by
4 comments, last by Icarus3 22 years, 7 months ago
What steps should i take to switch from windowed mode to fullscreen and reverse???
Advertisement
Go to see NeHe''s turiol
To enter fullscreen mode:

DEVMODE DisplayMode;

DisplayMode.dmSize = sizeof(DEVMODE);
DisplayMode.dmPelsWidth = ;
DisplayMode.dmPelsHeight = ;
DisplayMode.dmBitsPerPel = ;
DisplayMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;

ChangeDisplaySettings(&DisplayMode, CDS_FULLSCREEN);
---

To leave it:

ChangeDisplaySettings(NULL, CDS_FULLSCREEN);
---


Darkening
Darkening is right.

One strange thing though is that you must reset the display to windows desktop when switching resolutions inside the program. Or else the desktop will look messed up when you exit you program (at least this is what happens on my drivers/win98).

Anybody know a workaround for this?

Nehe''s homepage:
http://nehe.gamedev.net/

check out "basecode" or "lesson 1".
Is it the same way while I using VC++ ''s MFC? I mean not a win32 program?

Thanks.
AP: It''s the same with MFC, yes. Keep in mind switching to fullscreen might mess up any windows you already have showing, but ChangeDisplaySettings is just a windows call so it works no matter how you are displaying your windows. If you want your window to be created in the new mode, be sure to call ChangeDisplaySettings before you create the window.

FXO: There is no workaround.. if you change the settings you must change them back, just like with most things. It''s just like having to call Release() or whatever for DirectX objects, except in DirectX changing screen modes is built into the API and with OpenGL you must rely on the operating system functions to do it, but that doesn''t mean you don''t have to clean up.

This topic is closed to new replies.

Advertisement