Commit graph

267 commits

Author SHA1 Message Date
Sam Lantinga 13d9e41c3f SDL_WINDOWEVENT_SIZE_CHANGED was renamed SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED 2023-02-10 06:38:14 -08:00
Sam Lantinga 449b2289c8 Remove renaming for SDL_GetDisplayDPI() 2023-02-10 06:31:09 -08:00
Sylvain 7c4ec1867b Remove some vim config lines 2023-02-10 11:00:48 +01:00
Sam Lantinga fa599c7548 Fixed SDL_GetRendererOutputSize renaming 2023-02-09 17:31:44 -08:00
Sam Lantinga 9ff15e5382 Don't change M_PI in application code, that's not an SDL symbol 2023-02-09 17:26:15 -08:00
Sam Lantinga a357021800 Use GNU sed if available
Fixes update-copyright.sh on macOS, which doesn't support the -b option.
2023-02-06 15:47:16 -08:00
Sylvain 5d1006657a SDL_migration.cocci: remove metavariable warning 2023-02-05 17:48:18 +01:00
Sylvain 85143c28b5 SDL_migration.cocci: fix syntax 2023-02-05 09:37:37 +01:00
Sam Lantinga a34a84ba98
Rename int versions of the SDL2 render functions (#7235)
This makes it clear what the new versions are, and in the case of SDL_RenderDrawPoint() and SDL_RenderDrawLine(), the coccinelle script actually does the (float) casts for you.
2023-02-03 14:55:32 -08:00
Sam Lantinga 14a4ce8b59 Fixed SDL_ScaleMode values for consistency 2023-02-03 14:20:51 -08:00
Sam Lantinga dcd17f5473 Renderer logical size is now implemented as a render target
This fixes rounding errors with coordinate scaling and gives more flexibility in the presentation, as well as making it easy to maintain device independent resolution as windows move between different pixel density displays.

By default when a renderer is created, it will match the window size so window coordinates and render coordinates are 1-1.

Mouse and touch events are no longer filtered to change their coordinates, instead you can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into the rendering viewport.

SDL_RenderWindowToLogical() and SDL_RenderLogicalToWindow() have been renamed SDL_RenderCoordinatesFromWindow() and SDL_RenderCoordinatesToWindow() and take floating point coordinates in both directions.

The viewport, clipping state, and scale for render targets are now persistent and will remain set whenever they are active.
2023-02-03 12:57:37 -08:00
Anonymous Maarten 69aede6c9e Add missing _ in SDL_EVENT_LOCALECHANGED and SSDL_EVENT_TEXTEDITING_EXT 2023-02-02 00:49:09 +01:00
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
Anonymous Maarten 09e2f83e17 cmake: no more SDL3_* cache variables 2023-01-31 01:59:21 +01:00
Anonymous Maarten 9cf34908a1 cmake: pass VERSION to project() + don't use SDL_VERSION 2023-01-31 01:59:21 +01:00
Sam Lantinga 22c69bccdf Displays are now referenced by instance ID instead of index 2023-01-29 19:25:15 -08:00
Anonymous Maarten 758c0dd6d8 Rename mouse BUTTON(DOWN|UP) event to BUTTON_(DOWN|UP) 2023-01-29 19:24:48 -08:00
Sylvain 413376cdb3 migration: replace SDL_DisplayMode w and h by screen_w and screen_h 2023-01-29 12:19:09 -08:00
Sam Lantinga 31f464153d SDL_WINDOW_INPUT_GRABBED has been renamed SDL_WINDOW_MOUSE_GRABBED 2023-01-28 10:56:38 -08:00
Sam Lantinga e83c54f271 SDL_WINDOW_FULLSCREEN and SDL_WINDOW_FULLSCREEN_DESKTOP are now distinct flags 2023-01-28 10:56:38 -08:00
Ryan C. Gordon 726d6f9422
wikiheaders: Allow markdown in the wikipreamble string.
Reference Issue #6568.
2023-01-26 14:45:57 -05:00
Anonymous Maarten 330ad80014 cocci: fix game pad event types 2023-01-25 22:02:31 +01:00
Ryan C. Gordon 01cba48d18
wikiheaders: Add a \threadsafety tag to document threading details.
Reference Issue #7140.
2023-01-25 12:59:25 -05:00
Sylvain 724d92fd65 Rename SDL_GetDisplayDPI to SDL_GetDisplayPhysicalDPI
to avoid confusion with logical DPI
2023-01-25 00:04:00 -08:00
Sam Lantinga 7b50bae524 Renamed SDL events for clarity
Fixes https://github.com/libsdl-org/SDL/issues/6877
2023-01-24 07:26:48 -08:00
Anonymous Maarten 0770c55e8d cocci: remove SDL_INIT_NOPARACHUTE 2023-01-22 20:14:35 +01:00
Anonymous Maarten 967ebd78e6 cocci: also fix up SDL_CreateRenderer calls with non-default render indices 2023-01-22 20:04:40 +01:00
Sylvain 1a47cf5448
Revert "gen_audio_resampler_filter: Use SDL_PI_F"
This reverts commit 41221777ba.
2023-01-16 10:04:22 +01:00
Sylvain 41221777ba gen_audio_resampler_filter: Use SDL_PI_F 2023-01-16 09:24:27 +01:00
Sylvain 9eaea7d661 SDL_migration.cocci: simplify multiplicaction / division by 1 2023-01-12 20:52:37 +01:00
Sylvain 3b2e9d98df SDL_migration.cocci: migrate audio api 1.2 2023-01-12 15:01:31 +01:00
Sylvain 8bdc25f4e4 SDL_migration.cocci: set events 2023-01-12 11:56:49 +01:00
Sylvain ed1bdf32ee SDL_migration.cocci: more gamepad migration 2023-01-12 11:39:48 +01:00
Sylvain 9b0c660a03 SDL_migration: various name changes, and function removed 2023-01-12 11:08:15 +01:00
Sylvain 21e4be5a27 SDL_migration: add RW read/write 2023-01-12 10:43:08 +01:00
Sylvain efa2945502 SDL_migration.cocci: add SIMD Alloc / Free 2023-01-12 09:58:37 +01:00
Sylvain 439c0b0236 Add vulkan migration 2023-01-12 09:45:14 +01:00
Sam Lantinga 0ad22cfe37 Fixed version validation 2023-01-11 15:11:41 -08:00
Sylvain 84cd7214bd SDL_migration.cocci / rename_api.py: handle migration of enum/structure
and fix previous one in SDL_migration.cocci.
2023-01-11 23:33:14 +01:00
Sam Lantinga 9f721d492a Catch SDL_opengles2.h in rename_headers.py 2023-01-10 15:25:48 -08:00
Sam Lantinga 69b94145d3 Updated documentation for SDL_migration.cocci
Especially note that this can be installed and run in WSL on Windows
2023-01-10 07:54:18 -08:00
Anonymous Maarten c4b471bd13 Ensure training new line in cocci files 2023-01-10 16:43:15 +01:00
Anonymous Maarten ecc48b882d migration: change 2nd arg of SDL_CreateRenderer to NULL if it was -1 2023-01-10 16:11:22 +01:00
Sylvain Becker 5066fcde69
Add SDL_migration.cocci for SDL2 to 3 migration (#7042)
* Add SDL_migration.cocci for SDL2 to 3 migration
2023-01-10 15:25:00 +01:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga 78ccadd5a2 Speed up processing of update-copyright.sh 2023-01-09 09:38:36 -08:00
Sam Lantinga 228d9ae791 rename_headers.py covers begin_code.h/close_code.h 2023-01-04 23:50:08 -08:00
Sam Lantinga 566a559beb Fixed parsing symbols from SDL_oldnames.h 2023-01-04 13:51:00 -08:00
Sam Lantinga e76c1d74bc Added a python script to rename SDL2 headers to SDL3 headers 2023-01-04 11:20:38 -08:00
Sam Lantinga 406c8b79fe rename_symbols: only write new file if contents have changed
Also don't stop for other exceptions, just print them and keep going
2023-01-04 10:40:30 -08:00