Commit Graph

19336 Commits

Author SHA1 Message Date
Sam Lantinga 5d20bbf348 Presenting while drawing to a render target should fail.
People are adding present calls while rendering to render targets, not understanding that this doesn't make sense, and wondering why they get flicker on some systems. If there are programs that relied on the previous behavior we can add a hint to control this.

Fixes https://github.com/libsdl-org/SDL/issues/12432
2025-03-04 08:46:13 -08:00
Volian0 debbe1cf75
Fix for Message Box failing to init on X11 (#12455)
Fixed X11 message boxes failing to initialize, because the proper X Logical Font Description could not be found
2025-03-04 08:29:08 -08:00
Sam Lantinga 4bb46e93c8 Fixed clip rect when logical presentation is enabled
We don't need to include the logical offset, it's already included in the viewport.

Fixes https://github.com/libsdl-org/SDL/issues/12454
2025-03-04 08:24:18 -08:00
SDL Wiki Bot 7df0ffd436 Sync SDL3 wiki -> header
[ci skip]
2025-03-04 13:27:13 +00:00
Sam Lantinga 7c29c8b266 Added fullscreen_active to better track fullscreen state
This is true if fullscreen is pending or currently active. This is a better check in SDL_SetDesktopDisplayMode() because a fullscreen mode may be pending and complete asynchronously and the window hasn't been set to fullscreen yet.
2025-03-03 21:18:42 -08:00
Frank Praznik 3b9f0dff10
Use _this pointer to reference the video device 2025-03-03 18:39:44 -05:00
Frank Praznik 0ccf272eea
Check the display device before dereferencing
It can be null if the desktop mode is set early during initial display enumeration.
2025-03-03 11:24:25 -05:00
Frank Praznik 6c347cbf33
video: Handle Cocoa desktop mode switch inhibition in the video layer
The X backend had the same issue, so both Cocoa and X can be handled in the same location.
2025-03-03 10:50:20 -05:00
Sam Lantinga 24ec2ed785 Don't save temporary mode changes to the desktop mode
Fixes https://github.com/libsdl-org/SDL/issues/12441
2025-03-03 07:40:55 -08:00
Simon McVittie d57aa6f7af pipewire: Don't require pw_check_library_version() with Pipewire < 0.3.75
The Debian 12 'bookworm' stable release only has 0.3.65, which is earlier
than the introduction of that symbol. Similarly, Steam Runtime 3 'sniper'
and Steam Runtime 2 'soldier' have a backport of 0.3.65 from Debian 12,
so they have the same limitation.

steamrt/tasks#686

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-03-03 07:32:19 -08:00
Caleb Cornett 113eb6f01d gpu: Add BC2_RGBA_UNORM_SRGB to GetBlockWidth/Height functions 2025-03-03 01:35:16 -05:00
Sam Lantinga 2c7c3d4d7b Only use VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR on Android
This fixes Nintendo Switch where the identity bit isn't available. We only needed this on Android to automatically handle device user orientation.
2025-03-02 09:12:48 -08:00
Ozkan Sezer ca3c5fd409 fix build: s/SDL_DetectSandbox/SDL_GetSandbox/ 2025-03-02 19:40:02 +03:00
kemal eac63b4735 Add the definition for DBUS_TYPE_UNIX_FD to SDL_dbus.h 2025-03-02 08:03:57 -08:00
kemal 16f12c0d55 Implement the XDP Camera portal
This helps the Pipewire camera driver to access cameras
in a sandboxed environment without host Pipewire socket access.
Unlike other platforms, no event is sent when the user rejects
camera access. This is because there is no mechanism to query
cameras through the portal, and we only obtain access to the
Pipewire fd if the user accepts the request. The Pipewire driver
will attempt to open the host socket instead.
2025-03-02 08:03:57 -08:00
SDL Wiki Bot c3b415641a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:56:34 +00:00
SDL Wiki Bot 2a0223487f Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:55:59 +00:00
Sam Lantinga 1a7c206986 Save and restore error messages when rolling back after failed init
Fixes https://github.com/libsdl-org/SDL/issues/12439
2025-03-02 07:55:56 -08:00
Sam Lantinga 2c46c3d5b7 Updated dynamic API for new functions 2025-03-02 07:53:51 -08:00
expikr 5373271a12 forbid transform change while relative mode active 2025-03-02 07:53:09 -08:00
expikr 428f0dcd61 add SDL_SetRelativeMouseTransform 2025-03-02 07:53:09 -08:00
Arkadiusz Lach 67127afe3f Fix from #12118 2025-03-02 07:52:25 -08:00
Arkadiusz Lach e25ee22469 Added tiled 9-grid texture rendering function
* New function SDL_RenderTexture9GridTiled, borders and center is tiled instead of stretched
2025-03-02 07:52:25 -08:00
SDL Wiki Bot 954675b32a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:52:11 +00:00
Arkadiusz Lach 44bca81fdd Change default texture scale mode per renderer
* SDL_SetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode scale_mode)
* SDL_GetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode *scale_mode)
2025-03-02 07:51:17 -08:00
Caleb Cornett b0d2a4f355 gpu: Fix Z offset for D3D12 realigned 3D texture uploads 2025-03-02 00:04:57 -05:00
Frank Praznik b69201daeb cocoa: Don't overwrite the desktop mode when changing the fullscreen mode
Changing the mode triggers a display reconfiguration event, which will overwrite the desktop mode with the set fullscreen mode, preventing proper restoration when leaving fullscreen. Don't overwrite the desktop mode if the reconfiguration is due to a fullscreen mode switch.
2025-03-01 22:55:38 -05:00
Frank Praznik 078d737a27 cocoa: Run pending events to completion
Fullscreen spaces and miniaturization will always give us some notification that they succeeded or failed, so the timeout isn't required. This prevents errant timeouts when live-resize is active.
2025-03-01 19:33:38 -08:00
Sam Lantinga b0df1cbbef Updated to version 3.3.0 for development 2025-03-01 19:31:00 -08:00
Sam Lantinga 65864190cc Added testpen to the Xcode test project 2025-03-01 18:49:25 -08:00
Sam Lantinga 292e431748 Updated to version 3.2.6 for release 2025-03-01 18:30:34 -08:00
Sam Lantinga f0cb78e082 Handle XCreateIC() failing when composition UI is enabled
Fixes https://github.com/libsdl-org/sdl2-compat/issues/328
2025-03-01 13:54:07 -08:00
Sam Lantinga 55484ef023 Moved WIN_UpdateMouseCapture() to be with the other mouse functions 2025-03-01 12:54:17 -08:00
Sam Lantinga 020664bd10 Update mouse button state when re-entering a window
Fixes https://github.com/libsdl-org/SDL/issues/12423
2025-03-01 12:54:17 -08:00
Sam Lantinga b836ad4d4f Fix a root signature mismatch for the D3D12 renderer
The shaders hadn't been rebuilt after c74f273848

Fixes https://github.com/libsdl-org/SDL/issues/12276
2025-03-01 12:02:49 -08:00
Ryan C. Gordon a88105784f
camera: Delete some failure code that should have been removed before. 2025-03-01 14:52:56 -05:00
Brick f868408a3a Ceil the audio resampling rate to avoid over-estimating output samples.
Reverts 580a496391, fixes #12115
2025-03-01 11:07:55 -08:00
Anonymous Maarten cbdc93b17f cmake: make sure a SDL3 library is present when not using COMPONENTs 2025-03-01 17:54:45 +01:00
Anonymous Maarten 8a7beca122 camera: clear the spec when closing, so re-opening can probe again 2025-03-01 08:34:01 -08:00
SDL Wiki Bot ee5f5c9172 Sync SDL3 wiki -> header
[ci skip]
2025-03-01 16:26:19 +00:00
Sam Lantinga 6e4193b743 Note that the file names are UTF-8 encoded 2025-03-01 08:25:31 -08:00
Ozkan Sezer 60c65f9fa4 SDL_camera.c: fix failure-return in SDL_PrepareCameraSurfaces(). 2025-03-01 04:37:02 +03:00
Sam Lantinga b8c2bc143e Added build dependencies for Arch Linux
These are based on the dependencies listed at:
https://archlinux.org/packages/extra/x86_64/sdl3/
2025-02-28 16:31:10 -08:00
SDL Wiki Bot 7ab1412e20 Sync SDL3 wiki -> header
[ci skip]
2025-02-28 21:21:47 +00:00
Ryan C. Gordon 725af6ad16
camera: Fixed surface formats, etc, for Emscripten backend.
Fixes #12374.
2025-02-28 16:15:01 -05:00
Sam Lantinga ef23ebfb5a Fixed the cursor clip rect when toggling window borders on macOS 2025-02-28 11:57:34 -08:00
guitarfreak c682599448 GPU_d3d12: Switched the default swapchain scaling mode to none.
Since there is no option to change it this seems like a much better default value. The stretching behaviour is really off-putting.

The new behavior shows a small black border when resizing the windows. This makes it more in line with the other backends and it's what you would expect to happen as a user.
2025-02-28 11:33:51 -08:00
guitarfreak ea513fd47c Fixed vulkan gpu backend android orientation behaviour to just work like on iOS.
I changed it so that the OS does the orientation change itself with a potential performance penalty.
This makes it automatically do the right thing, just like on iOS which would make the orientation change behaviour more consistent across different platforms.

But without adding an option to the user, this would disallow the user solving the problem in his in the app/shaders and saving some performance.

It's up to you to decide what to do. But I changed this in my local copy of the source for my use case.
But this also
2025-02-28 07:34:16 -08:00
Elbagast 87b1c9736f
Fix pen generated mouse events not having SDL_PEN_MOUSEID (#12392)
* Update SDL_mouse.c

Stop a mouseID of SDL_PEN_MOUSEID being discarded when dispatching mouse events. I'm not sure if this enough to fix the lack of SDL_PEN_MOUSEID being emitted.

* Update SDL_mouse.c

Since we test for touch input here we also test for pen input in the same way.

* Stop duplicate synthetic touch events

If SDL_HINT_PEN_MOUSE_EVENTS and SDL_HINT_MOUSE_TOUCH_EVENTS are both enabled, the pen generated synthetic mouse event will then produce a touch event without this additional check.

This requires the previous commits in order to do anything since it needs to be able to identify those pen generated mouse events.
2025-02-27 20:45:27 -05:00
Wim Taymans a44107540d sysjoystick: don't leak fd on error 2025-02-27 19:49:46 -05:00