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.

Questions & Answers

Answers are generated by AI models and may not have been reviewed. Be mindful when running any code on your device.

Managing Different Aspect Ratios
What happens if a player has a monitor with a different aspect ratio than our game's resolution?
Smooth Fullscreen Transitions
How can I smoothly transition between windowed and fullscreen modes without the screen going black?
Using Bitwise AND with Window Flags
What's the purpose of the bitwise AND operator (&) when checking window flags? Why can't we use == instead?
Restoring Display Settings After Crashes
When using exclusive fullscreen, how can I ensure the display settings are properly restored if my game crashes?
Saving Display Preferences
How can I save the player's preferred fullscreen mode and restore it the next time they launch the game?
Or Ask your Own Question
Get an immediate answer to your specific question using our AI assistant