Commit graph

18557 commits

Author SHA1 Message Date
Ethan Lee
e992522cb2 Xbox buildfixes for WarpCursor jitter fix, dark mode 2024-12-20 00:55:54 -05:00
SDL Wiki Bot
b2c15a8c2a Sync SDL3 wiki -> header
[ci skip]
2024-12-20 00:35:23 +00:00
cosmonaut
0f9e86fe1c tests: Fix GPU tests crashing when window is minimized 2024-12-19 16:21:50 -08:00
SDL Wiki Bot
c9e22d4672 Sync SDL3 wiki -> header
[ci skip]
2024-12-20 00:13:34 +00:00
Ryan C. Gordon
ff366fba87
include: Move SDL_HAS_BUILTIN to SDL_begin_code.h, document it.
This macro fits better here, since most of the other macros in this file are
for testing similar compiler/target features, etc.
2024-12-19 19:12:56 -05:00
cosmonaut
e46d8756e5 tests: Update GPU tests to use new swapchain best practice 2024-12-19 15:55:04 -08:00
Ryan C. Gordon
401c8f8e4e
SDL_timer.h: Fixed doxygen typo. 2024-12-19 16:46:42 -05:00
SDL Wiki Bot
2f9a45af60 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 21:44:12 +00:00
Ryan C. Gordon
0c42891826
include: Filled in more documentation gaps. 2024-12-19 16:42:14 -05:00
Frank Praznik
3ce68f80bc
wayland: Clean up the relative pointer if the seat capability is removed
Also use wl_pointer_release, when available, instead of destroy.
2024-12-19 14:33:06 -05:00
Frank Praznik
7c8171da92
wayland: Handle the relative pointer manager appearing after the seat has been initialized 2024-12-19 14:26:51 -05:00
Frank Praznik
4bfc8f84f7
tests: Add a raw event mode to testrelative
Add a code path to test raw motion events (activated by '--raw').
2024-12-19 14:14:36 -05:00
Frank Praznik
8c849ecc6c
wayland: Add support for the MOUSE_RAW_* events
Mouse button numbers are passed through directly, and axis values are passed through as the raw, 32-bit, wl_fixed_t 24.8 fixed-point values, which need to be divided by the denominator to convert to int/float.
2024-12-19 14:10:09 -05:00
Frank Praznik
fce922b66c
wayland: Add support for the SDL_MOUSE_RELATIVE_SYSTEM_SCALE hint
The relative pointer protocol sends both the accelerated and unaccelerated deltas, so select between them based on the hint value.
2024-12-19 14:10:08 -05:00
SDL Wiki Bot
d6a95ae198 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 18:54:59 +00:00
Sam Lantinga
42de2ac6a9 Fixed typo 2024-12-19 10:51:02 -08:00
Sam Lantinga
e08f34c3be Removed SDL_HINT_MOUSE_RELATIVE_MODE_WARP
This complicated mouse handling and is a rarely tested path. Real relative mode is much better performance and higher precision.
2024-12-19 10:33:02 -08:00
Sam Lantinga
6e0df0af24 Reduce the possibility of SDL_LockMutex getting called on a destroyed mutex after SDL_StopEventLoop 2024-12-19 09:32:31 -08:00
SDL Wiki Bot
519923ea80 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 17:20:47 +00:00
Ryan C. Gordon
624a4d5f26
include: Documented important SDL_begin_code symbols. 2024-12-19 12:19:46 -05:00
expikr
5c0f8dc179
add alternate raw mouse motion events with windows implementation (#10042) 2024-12-18 17:29:27 -08:00
expikr
345cab1e36
streamline cursor clipping logic on windows (#11237)
This commit does the following:
- add logic in the `WM_MOUSEMOVE` case of the Window to conditionally call `WIN_UpdateClipCursor` upon receiving cursor motion if SDL is expecting the mouse to be clipped in some way (Fixes #7890)
- remove Windows-specific periodic refresh of cursor clipping and its `SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL` hint (superceded by the above bullet point)
- streamline the processing logic within `WIN_UpdateClipCursor` for better readability of each branch, and avoid calling the Platform API until it is absolutely necessary.
- move `relative_mouse_center` field from Windows-specific per-window `SDL_WindowData` to the global `SDL_Mouse` struct, and the corresponding hint callbacks to `SDL_mouse.c` instead of `SDL_windowswindow.c`
2024-12-18 17:25:06 -08:00
Marcin Serwin
35a9d156a6 render: convert tmotion vectors to render basis
When using `SDL_ConvertEventToRenderCoordinates` with
`SDL_EVENT_FINGER_MOTION` events it converts `x` and `y` coordinates but
does not convert the the `dx` and the `dy` unlike `xrel` and `yrel` of
mouse motion events. This is means that these are rather useless after
conversion. This change unifies this behavior between touch and mouse
motion events.
2024-12-18 17:17:14 -08:00
pixelsuft‮
3739749404
Improve Win32 darkmode and fix title bar's context menu (#11543)
Use hidden uxtheme.dll and user32.dll functions for darkmode instead of using DwmSetWindowAttribute.
Fixes context menu on title bar.
2024-12-18 17:11:31 -08:00
SDL Wiki Bot
10f868abf4 Sync SDL3 wiki -> header
[ci skip]
2024-12-19 01:06:43 +00:00
Sam Lantinga
f81472d767 Document that you should read from processes before waiting for them to exit.
Fixes https://github.com/libsdl-org/SDL/issues/11645
2024-12-18 16:18:44 -08:00
Frank Praznik
3001c61de0 x11: Use the master pointer device for absolute motion
Slave pointer devices can seemingly lag behind the master for some reason, so use the master pointer coordinates for absolute motion.

Master events are now only filtered out on the pen path.
2024-12-18 18:21:22 -05:00
Sam Lantinga
835b6e0c1a Enable high refresh rates on iOS
Fixes https://github.com/libsdl-org/SDL/issues/7518
2024-12-18 14:36:30 -08:00
Eduard Gushchin
da80b9bce5 Fixed an inaccuracy in the documentation for SDL_ConvertPixelsAndColorspace 2024-12-18 14:20:24 -08:00
Eduard Gushchin
2ce21d1fed Fixed an inaccuracy in the documentation for SDL_CancelGPUCommandBuffer 2024-12-18 14:18:33 -08:00
Eduard Gushchin
0ca8027205 Fixed an inaccuracy in the documentation for SDL_PenProximityEvent and SDL_PenMotionEvent 2024-12-18 13:02:14 -08:00
SDL Wiki Bot
4d9e7a2a68 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 19:09:01 +00:00
cosmonaut
b5eea03d1e GPU: Clarify presentation concerns in SDL_gpu.h 2024-12-18 11:08:14 -08:00
SDL Wiki Bot
7dd523fbb1 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 18:57:45 +00:00
SDL Wiki Bot
48a0adb2ac Sync SDL3 wiki -> header
[ci skip]
2024-12-18 15:41:13 +00:00
Ryan C. Gordon
4d4a2786bb render: Updates to format-string versions of SDL_RenderDebugText.
- Removes SDL_RenderDebugTextV
- Changes SDL_RenderDebugTextF to SDL_RenderDebugTextFormat and tweaks it to
  work in a world without SDL_RenderDebugTextV.
- Tweaked rendering position of formatted text in the example program.
2024-12-18 10:40:31 -05:00
williamist
6abebca943 Fix format string in debug-text example
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2024-12-18 10:40:31 -05:00
williamistGitHub
1d0e28a5b3 Add SDL_RenderDebugTextF & SDL_RenderDebugTextV
This should make it easier to quickly put important numbers and such on
the screen without having to format them into a string manually.
2024-12-18 10:40:31 -05:00
SDL Wiki Bot
5608bf5866 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 06:22:41 +00:00
Evan Hemsley
0fbcd0d586
GPU: Optimize usage of D3D12 staging descriptors (#11657) 2024-12-17 22:22:22 -08:00
Ryan C. Gordon
e957840d34
include: Filling in some more documentation gaps. 2024-12-18 01:18:40 -05:00
Semphris
684098fac3 Fix possible bug with Windows dialogs
The Windows implementation of dialogs use the Win32 API, which expects the file filters to have null bytes as separator, and two null bytes at the end of the filter list. To help with string manipulation, the internal code uses 0x01 bytes instead of null bytes, and converts all 0x01 bytes into null bytes at the last moment. If someone decides to put two consecutive 0x01 bytes in their filter names, the code might mistakenly pick them up and convert them to null bytes, leading to Windows failing to pick up later filters. In practice, this is probably not so bad, since it requires someone to have control over file filters already, and allows at most ignoring the following file filters. It is also unlikely to happen by accident since 0x01 is not printable. This commit fixes that by replacing all the 0x01 bytes with the space character.
2024-12-17 20:50:39 -08:00
Semphris
bc9c86bcc2 Dialog: Add suffix to filters all the time
For some obscure reason I can't remember, I had made it so the suffix would be added only if the filter list was empty. That isn't the expected behavior and caused a mishandling of memory on Windows, which requires a two-null-bytes suffix.
2024-12-17 20:50:39 -08:00
Ryan C. Gordon
b58e6d7274
.wikiheaders-options: Include CPU intrinsics macros in quick reference. 2024-12-17 23:37:28 -05:00
Ryan C. Gordon
c9ab8ad8d9
SDL_intrin.h: Added missing NEON and Altivec documentation. 2024-12-17 23:33:05 -05:00
SDL Wiki Bot
d38c09e5c4 Sync SDL3 wiki -> header
[ci skip]
2024-12-18 04:26:44 +00:00
Ryan C. Gordon
6730cf7bed
SDL_intrin.h: Add documentation. 2024-12-17 23:25:25 -05:00
Ryan C. Gordon
2f68efda83
wikiheaders: Add underscore to the "big ascii" character table. 2024-12-17 23:23:13 -05:00
SDL Wiki Bot
19bdc01b8c Sync SDL3 wiki -> header
[ci skip]
2024-12-17 15:46:19 +00:00
Frank Praznik
eda0261c4e video: Drop size and position requests for windows in a fixed size/position state
It is not uncommon for clients to redundantly set the window size and position, either as a holdover from an SDL 1 port, when this was required, due to any window state change triggering a universal update function that sets all window state, even if unnecessary (e.g. always calling SDL_SetWindowSize(), even if the window is fullscreen), or due to the use of compatability layers. Historically, these clients expect that their behavior won't override the base window state, which is an assumption that the windowing changes in SDL 3 broke by caching size and position changes that can't be applied immediately.

This change drops size and position requests when the window is in the maximized and fullscreen states (fullscreen-desktop windows will be repositioned, but the non-fullscreen floating position will not be overwritten), which is behavior more in line with existing client assumptions, and should ease the porting process, as well as prevent annoying bugs when older software is run via sdl2-compat.

In the process of making these changes, pending window state has been moved to separate variables in the SDL_Window struct, as this fixes bugs regarding fullscreen display selection and centering windows immediately after resize on asynchronous platforms, which had issues due to pending state possibly being overwritten.
2024-12-17 10:45:40 -05:00