Skip to main content
GameDev.net gamedev.net
🔒 Locked

full screen mode (PC)

Started by cyrfer Jan 14, 2011 at 5:00 PM 6 replies 2.4k views
Original Post
cyrfer
cyrfer
Hi,
I'm wondering 2 things:
1- The reason for better performance in full screen mode? I've read in a few places that this is recommended.
2- How to setup this mode? Is it just a window that is the same size as the desktop? Are there any special flags needed for window creation (Windows, xp, 7) or when rendering with Direct3D or GL?
Thanks!
Moe
Moe
1. It can also be important for the sake of immersion. People are a little more likely to get into your game if they don't see whatever other windows in the background.
2. It depends on what API you are using. Setting up full-screen mode depends on what you are using to do your drawing. There should be plenty of info out there depending on how you are doing things.
Promethium
Promethium
On Windows you can get increased performance by going into fullscreen. If your Direct3D application is running in a window then the driver must blit (copy) the back buffer to the front buffer. However, in fullscreen mode driver can flip (pointer swap) between the back and front buffer. Obviously a pointer swap is cheaper than a memory copy.

When calling Present on a full-screen application, the swap chain flips (as opposed to blits) the contents of the back buffer to the front buffer. This requires that the swap chain was created using an enumerated display mode (specified in DXGI_SWAP_CHAIN_DESC). If you fail to enumerate display modes, or incorrectly specify the display mode in the description, the swap chain may perform a blit instead. The blit causes an extra stretching copy as well as some increased video memory usage, and is difficult to detect. To avoid this problem, enumerate display modes, and initialize the swap chain description correctly before creating the swap chain. This will ensure maximum performance when flipping in full-screen mode and avoid the extra memory overhead.[/quote]
(source)
SimmerD
SimmerD
Also vista and above will boost your thread's priority if you are in d3d fullscreen mode. OpenGL always runs in a window, even it it appears fullscreen to you.

You can get back this thread perf in windowed mode by boosting yoru threads priority yourselfi

To get fullscreen mode In direct3d 8 & 9, you specify windowed = false in the presentparameters struct used in CreateDevice() and Device->Reset().
cyrfer
cyrfer
1. I'm interested in the performance differences. I'm guessing there is a performance benefit from a reasons like: the OS will do less work, or the GPU has direct control?
2. I'm asking what are the platform nuances. The documentation is what I'm looking for. I assume there is special flag for window creation on Windows and I want to know if anything is required of the graphics drivers (I doubt anything is required of the driver but you never know...).
cyrfer
cyrfer
Thanks Promethium and SimmerD. Those reasons make sense. Now I have a reason to find how to get this working.
21st Century Moose
21st Century Moose
In D3D, fullscreen is an "exclusive mode". This means that the program has exclusive comtrol over the desktop, which in turn means that because the OS is now aware that nothing else can use the desktop, it should - in theory - be faster. OpenGL doesn't have the concept of an "exclusive mode" (this is consistent with the OpenGL design philosophy where things like this are left to the windowing system to manage) and - as mentioned upthread - a "fullscreen" mode is just a topmost window that's the same dimensions as the desktop (using ChangeDisplaySettings (or equivalent) to switch resolution if desired). I'm not sure if the OpenGL driver model is able to detect that it's running fullscreen and also tell the OS that it should behave as if it's in an exclusive mode, but I'd guess that this would be implementation-dependent so you probably shouldn't rely on it.

In practice, and assuming that fillrate is your bottleneck, an 800x600 (for example) windowed mode will probably always run faster than a fullscreen mode at full desktop resolution. If fillrate isn't your bottleneck then there should really be no difference. So this is application-dependent and - as is normally the case - you really need to know your application and know where it's bottlenecks are before making any definite decision.
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 
Acharis
Acharis
You can create DirectDraw surface and then use OpenGL on top of it (my experience is outdated so not sure if it is valid anymore, but this one worked flawlessly in older versons of DX).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.