Desktop vs Exclusive Fullscreen
Why would we want to use desktop fullscreen mode if exclusive fullscreen has better performance?
While exclusive fullscreen mode can offer better performance, desktop fullscreen (also called borderless fullscreen) provides several important advantages that often make it the preferred choice for modern games.
Faster Alt+Tab Switching
When using exclusive fullscreen, switching between applications takes several seconds as the display mode needs to change each time. With desktop fullscreen, players can instantly switch between your game and other applications, providing a much smoother multitasking experience.
Multiple Monitor Support
Desktop fullscreen works better with multiple monitors. Players can interact with other applications on their secondary monitors while your game runs on the primary display. In exclusive fullscreen, switching focus away from the game often minimizes it or causes display flickering on all monitors.
Stream Compatibility
Desktop fullscreen works more reliably with streaming software like OBS or Discord's screen sharing. Exclusive fullscreen can sometimes cause capture issues or black screens.
Here's how you might implement a configuration option for this:
#include <SDL.h>
#include <iostream>
enum class FullscreenMode {
Windowed,
Desktop,
Exclusive
};
void SetFullscreenMode(
SDL_Window* Window,
FullscreenMode Mode
) {
switch (Mode) {
case FullscreenMode::Windowed:
SDL_SetWindowFullscreen(Window, 0);
break;
case FullscreenMode::Desktop:
SDL_SetWindowFullscreen(Window,
SDL_WINDOW_FULLSCREEN_DESKTOP);
break;
case FullscreenMode::Exclusive:
SDL_SetWindowFullscreen(Window,
SDL_WINDOW_FULLSCREEN);
break;
}
}
The performance difference between the modes is often minimal on modern systems, so many players prefer the convenience of desktop fullscreen over the slight performance advantage of exclusive fullscreen.
Fullscreen Windows
Learn how to create and manage fullscreen windows in SDL, including desktop and exclusive fullscreen modes.