Go to file
Sam Lantinga 6b137579ea Windows default to fullscreen desktop mode if they don't pick an explicit video mode
Rather than iterating over display modes using an index, there is a new function SDL_GetFullscreenDisplayModes() to get the list of available fullscreen modes on a display.
{
    SDL_DisplayID display = SDL_GetPrimaryDisplay();
    int num_modes = 0;
    SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes);
    if (modes) {
        for (i = 0; i < num_modes; ++i) {
            SDL_DisplayMode *mode = modes[i];
            SDL_Log("Display %" SDL_PRIu32 " mode %d:  %dx%d@%gHz, %d%% scale\n",
                    display, i, mode->pixel_w, mode->pixel_h, mode->refresh_rate, (int)(mode->display_scale * 100.0f));
        }
        SDL_free(modes);
    }
}

SDL_GetDesktopDisplayMode() and SDL_GetCurrentDisplayMode() return pointers to display modes rather than filling in application memory.

Windows now have an explicit fullscreen mode that is set, using SDL_SetWindowFullscreenMode(). The fullscreen mode for a window can be queried with SDL_GetWindowFullscreenMode(), which returns a pointer to the mode, or NULL if the window will be fullscreen desktop. SDL_SetWindowFullscreen() just takes a boolean value, setting the correct fullscreen state based on the selected mode.
2023-02-01 12:05:25 -08:00
.github ci: don't upload test directory for ps2 workflow separately 2023-02-01 20:04:47 +01:00
VisualC cmake: capitalize SDL3::Headers target 2023-01-31 01:59:21 +01:00
VisualC-GDK Moved testautomation data out of SDL_test library 2023-01-26 10:25:44 -08:00
VisualC-WinRT Moved testautomation data out of SDL_test library 2023-01-26 10:25:44 -08:00
Xcode cmake: capitalize SDL3::Headers target 2023-01-31 01:59:21 +01:00
android-project Android: display_mode scale: cast to do a float division 2023-01-27 08:17:20 -08:00
build-scripts Windows default to fullscreen desktop mode if they don't pick an explicit video mode 2023-02-01 12:05:25 -08:00
cmake cmake: fix installed SDL3::SDL3_test + test on ci 2023-01-31 05:29:38 +01:00
docs Windows default to fullscreen desktop mode if they don't pick an explicit video mode 2023-02-01 12:05:25 -08:00
include Windows default to fullscreen desktop mode if they don't pick an explicit video mode 2023-02-01 12:05:25 -08:00
mingw/pkg-support/cmake build: don't add SDL3 subfolder to include path for external projects 2022-11-27 14:33:13 -08:00
src Windows default to fullscreen desktop mode if they don't pick an explicit video mode 2023-02-01 12:05:25 -08:00
test Windows default to fullscreen desktop mode if they don't pick an explicit video mode 2023-02-01 12:05:25 -08:00
wayland-protocols wayland: Add high-resolution event timestamp support 2022-12-04 16:56:26 -08:00
.clang-format Commented out syntax that causes Visual Studio 2019 to complain on every edit 2022-12-02 00:43:01 -08:00
.editorconfig Fixed formatting for Haiku cc files 2023-01-25 03:03:41 -08:00
.gitignore Removed QtCreator entries from .gitignore 2023-01-04 11:18:18 -08:00
.wikiheaders-options wikiheaders: Fixed SDL2 wiki link. 2023-01-26 14:50:52 -05:00
Android.mk Create a static SDL_test library on Android 2023-01-25 13:06:42 -08:00
BUGS.txt Cleaned up a few more Bugzilla mentions. 2021-02-12 14:46:49 -05:00
CMakeLists.txt cmake: fix installed SDL3::SDL3_test + test on ci 2023-01-31 05:29:38 +01:00
CREDITS.txt Use Apple's nomenclature for macOS and iOS 2022-11-25 16:00:06 -08:00
INSTALL.txt Use Apple's nomenclature for macOS and iOS 2022-11-25 16:00:06 -08:00
LICENSE.txt Updated copyright for 2023 2023-01-09 09:41:41 -08:00
README-SDL.txt More HTTPS changes in the documentation. 2017-02-16 16:52:03 -05:00
README.md First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
TODO.txt Fixed up legacy MoinMoin URLs at wiki.libsdl.org 2021-04-01 12:20:33 -04:00
WhatsNew.txt Add SDL_ConvertAudioSamples() helper function 2023-01-24 08:26:09 -08:00

README.md

Simple DirectMedia Layer (SDL) Version 3.0

https://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

More extensive documentation is available in the docs directory, starting with README.md

Enjoy!

Sam Lantinga (slouken@libsdl.org)