PDA

View Full Version : Full Screen Question



Questions Burner
12-04-2001, 10:14 PM
Is full screen is just a window with WS_POPUP style and position at (0, 0) with the width of screen and height of screen?

DFrey
12-04-2001, 10:38 PM
On most hardware that is what it would be in Windows. I hesitate to even mention the exceptions but I will if only for the sake of trivia. On old Voodoo cards, you always got a fullscreen regardless of how big the window was, since they were secondary video cards.

Questions Burner
12-07-2001, 03:03 AM
Then what's the use of

ChangeDisplaySetting(&dmSetting, CDS_FULLSCREEN);

Tron
12-07-2001, 06:47 AM
the CDS_FULLSCREEN flag is used to remove the taskbar (otherwise it would be displayed over your 'fullscreen' window)

Bob
12-07-2001, 06:48 AM
ChangeDisplaySettings is used to change the display settings (no joke http://www.opengl.org/discussion_boards/ubb/rolleyes.gif ). It's a pretty important part, because if you have a default desktop resolution of 1280x1024, but want to run fullscreen in 640x480, you have to change the display settings. Otherwise, the resolution will remain 1280x1024.

CDS_FULLSCREEN tells Windows that the mode you set is a temporary mode, and is not supposed to be written in the registry. This means that if you don't restore the resolution, it will be back to the original next time you restart Windows. I think this is also the reason why you can call ChangeDisplaySettings(NULL, 0) to restore resolution when your program exits.
If you use CDS_GLOBAL or CDS_UPDATEREGISTRY, you permanently change the display settings. CDS_FULLSCREEN has nothing to do with creating a fullscreen window.

kehziah
12-07-2001, 09:56 AM
I believe that Tron is right regarding the taskbar. Otherwise CDS_FULLSCREEN would be useless : passing 0 would do the job (MSDN quote : "0 | The graphics mode for the current screen will be changed dynamically". That's what we want, isn't it?). What is the difference code-wise between "I want to resize my desktop *with* the taskbar" and "I want to resize my desktop *without* the taskbar (ie go in fullscreen mode as we usually say)? It might be the CDS_FULLSCREEN flag.

Anyway, as usual, Win32 API documentation is not clear.

I agree with you Bob on the registry part.

Bob
12-08-2001, 02:28 AM
I agree with you Bob on the registry part.

What, you don't agree on CDS_FULLSCREEN being a temporary change of the display settings? http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

If you want to go back to the original settings, it's best for you you didn't make a permanent change http://www.opengl.org/discussion_boards/ubb/smile.gif

kehziah
12-08-2001, 03:54 AM
What's the difference between a "temporary" change, and a "permanent" change?? Simply the registry update.

So if you don't specify CDS_UPDATEREGISTRY, the change will be temporary, ie you will be able to go back to the original settings with the usual code lide

ChangeDisplaySettings(NULL, 0);

The code below works on my Win2000 system :


#include <windows.h>

void main()
{
DEVMODE dev;
ZeroMemory(&amp;dev,sizeof(DEVMODE));
dev.dmSize = sizeof(DEVMODE);
dev.dmBitsPerPel = 32;
dev.dmPelsWidth = 1024;
dev.dmPelsHeight = 768;
dev.dmDisplayFrequency = 75;
dev.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLA YFREQUENCY;

ChangeDisplaySettings(&amp; dev, 0 /*CDS_FULLSCREEN*/);

Sleep(5000);

ChangeDisplaySettings(NULL, 0);
}
However, there is a difference between the two (with or without CDS_FULLSCREEN) : if I have a maximized window, it is resized when using 0, and not resized when using CDS_FULLSCREEN. This explains what they call "a temporary change". So according to M$ vocabulary, my first statement is false (registry update is not the only difference). *But* you can still go back to the original settings if you don't set the CDS_UPDATEREGISTRY flag (eg using 0).

Note : when using 0, the maximized window is resized, letting room at the bottom for the taskbar, but the taskbar doesn't show...

Questions Burner
12-08-2001, 04:10 AM
Have another question.
By using CDS_FULLSCREEN, can I increase the frame rate?

kehziah
12-08-2001, 04:27 AM
Short answer : no.

It is a common mistake to think that an app will run faster in fullscreen mode than in windowed mode. Maybe it's because on old 3D accelerators you could only get hardware acceleration in fullscreen mode. But these times are over http://www.opengl.org/discussion_boards/ubb/wink.gif

Bottom line : your app won't run faster in 640*480 fullscreen mode than in a 640*480 window.

DFrey
12-08-2001, 10:25 AM
That's not a given kehziah. For double buffered applications, some drivers do page flipping in fullscreen and block transfers in windowed mode. There could be a significant difference in performance in this case.

kehziah
12-08-2001, 03:52 PM
You're right. I was giving a short (inaccurate) answer. Also, using a different color format from the desktop format would probably slow down the app because of conversion. Setting fullscreen mode with apropriate pixelformat would help.

[This message has been edited by kehziah (edited 12-08-2001).]

Questions Burner
12-09-2001, 09:27 AM
Thank you guys very much!
http://www.opengl.org/discussion_boards/ubb/smile.gif

Keermalec
12-11-2001, 06:59 AM
Also your framerate will not go above your screen refresh rate. So if, like me, your screen refresh is limited to 60 Hz at 1600x1200, then your 640x480 window will not go above 60 fps, while in fullscreen it may go to 160 fps or whatever.

Platinum
12-12-2001, 07:33 PM
Originally posted by Keermalec:
Also your framerate will not go above your screen refresh rate. So if, like me, your screen refresh is limited to 60 Hz at 1600x1200, then your 640x480 window will not go above 60 fps, while in fullscreen it may go to 160 fps or whatever.

I think it depends only on when you have the v-sync on and off. If it is on in fullscreen mode, the framerate will no go above the refresh rate. And when it is off in windowed mode, framerate can go much higher.