Ivan Epifanov
6da4d94abf
VITA: implement camera subsystem
2024-10-17 10:24:17 -07:00
Ivan Epifanov
f79f21217b
VITA: fix yuv texture update
2024-10-17 07:53:26 -07:00
Ozkan Sezer
4612db21a3
SDL_utils.c: restrict gethostname() usage to non-windows
...
Reference issue: https://github.com/libsdl-org/SDL/issues/11228 .
2024-10-17 12:47:02 +03:00
Sam Lantinga
c41b2bb855
SDL_ShouldIgnoreGamepad() should take product IDs rather than a guid.
...
This lets us early out when scanning for new hardware more quickly.
2024-10-16 16:47:29 -07:00
Sam Lantinga
8a30def5f2
Only use Steam Virtual Gamepads if we're running under Steam
...
Fixes https://github.com/libsdl-org/SDL/issues/11214
Fixes https://github.com/libsdl-org/SDL/issues/11215
2024-10-16 16:47:29 -07:00
Sam Lantinga
28504f5791
Steam virtual gamepad info isn't available in the macOS sandbox
2024-10-16 16:47:29 -07:00
Sam Lantinga
d6981da5a4
Added SDL_GetSandbox()
...
This adds support for detecting whether you're running in a sandbox on macOS
2024-10-16 16:47:29 -07:00
Sam Lantinga
d7b1ba1bfc
Added support for the Steam Virtual Gamepad on macOS Sequoia
2024-10-16 16:47:29 -07:00
Sam Lantinga
a027ec59ca
Make the name of the Steam Deck Controller consistent.
...
It will be named "Steam Deck Controller" regardless of whether you're running under Steam.
2024-10-16 08:23:29 -07:00
Sylvain
09e3af58b5
Fixed bug #10954 : software renderer: examples/renderer/10-geometry missing a triangle
...
typo when changing return code from int to bool
2024-10-16 16:48:05 +02:00
Ivan Epifanov
860e38a3a2
VITA: fix shader color format
2024-10-16 07:43:14 -07:00
Sam Lantinga
cbbad4051b
Treat a button press location as an implicit mouse move
...
This fixes having the incorrect location for mouse button presses on Steam Deck under gamescope. This works around a bug where the mouse motion appears to come at the next button press, and comes from the xwayland-pointer device instead of the xwayland-relative-pointer device which is delivering mouse button events.
2024-10-15 22:30:38 -07:00
Kyle Sylvestre
e5fa929245
Report win32 last error string windows_file_open ( #11224 )
2024-10-15 19:47:06 -07:00
Sam Lantinga
97f1da73da
Rename GPU properties for consistency
2024-10-15 15:36:26 -07:00
Caleb Cornett
9af5ffcfbe
Improve support for private platforms ( #11220 )
2024-10-15 18:02:07 -04:00
Frank Praznik
66d09a1cda
wayland: Adjust primary display selection priority
...
Portrait displays are typically used as secondaries and almost certainly not what a user wants a game or movie initially becoming full screen on if a landscape display is available. Increase the priority of selecting a landscape display over a portrait display.
2024-10-15 15:59:31 -04:00
Frank Praznik
553fc5fe0e
wayland: Expose displays in a deterministic order, and attempt to better handle selecting a primary display.
...
Wayland can expose displays in any arbitrary order, and doesn't have the native concept of a primary display. However, there are games that presume that the first listed display is the primary, which can lead to problems if that output isn't necessarily the ideal one, as they may use that display to build a resolution list or as the default fullscreen output. This sorts displays by position, then attempts to find the primary display, first by querying the explicit ordering hint, then the GNOME DBus property, then tries to determine the 'best' display according to the criteria that is generally ideal for games and media playback.
The makes the list of displays deterministic, as long as the desktop configuration remains static, with a reasonably appropriate one prioritized as primary, even if there is no explicit way to retrieve the primary display. In the case where a user has a particularly esoteric physical display configuration, the new hint enables explicitly overriding the sorting and selection logic, allowing the entire display order to be customized, if necessary.
2024-10-15 13:52:35 -04:00
Caleb Cornett
cdaaabb978
GPU: Fix Metal sampler address mode order
2024-10-15 10:46:04 -04:00
Sam Lantinga
afee27a530
Make sure stdio handles are in blocking mode
...
Standard I/O doesn't work well with non-blocking handles, so make sure any pipes are in blocking mode before launching child processes.
Fixes https://github.com/libsdl-org/SDL/issues/10998
2024-10-14 22:10:49 -07:00
Sam Lantinga
bb764e3106
Added support for full range BT.709 YUV conversion
...
Also added simple colorspace testing to testyuv.
2024-10-14 20:36:46 -07:00
Zack Middleton
edb28e79b5
Make SDL_LoadBMP() use true instead of 1
2024-10-14 20:07:03 -07:00
Zack Middleton
51dc978785
Don't overwrite the SDL_IOFromFile() error in SDL_LoadFile()
2024-10-14 20:07:03 -07:00
Zack Middleton
fb43dc3097
Set error for NULL SDL_IOStream in SDL_LoadWAV_IO()
2024-10-14 20:07:03 -07:00
cosmonaut
00bb81de76
GPU: Allow size queries on depth formats
2024-10-14 14:28:21 -07:00
cosmonaut
57f2577c65
GPU Vulkan: Fix depth-only framebuffer leak
2024-10-14 10:19:07 -07:00
Ozkan Sezer
9fac4b9f5f
SDL_windowsmodes.c: Fix MSVC builds against SDKs older than 10.0.17134.0
...
workaround the missing DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL enum value
and DISPLAYCONFIG_SDR_WHITE_LEVEL struct.
Fixes: https://github.com/libsdl-org/SDL/issues/11193
Closes: https://github.com/libsdl-org/SDL/pull/11205
2024-10-14 09:04:25 -07:00
Sam Lantinga
f9d490045b
Fixed uikit crash when GLES is disabled
...
Fixes https://github.com/libsdl-org/SDL/issues/11208
2024-10-14 08:58:02 -07:00
Ryan C. Gordon
c20918b0fb
render: Add SDL_RenderDebugText().
...
Fixes #11201 .
2024-10-14 02:45:33 -04:00
Sam Lantinga
1cc85c912b
Check return value of SDL_small_alloc()
...
Fixes https://github.com/libsdl-org/SDL/issues/8959
2024-10-13 14:07:26 -07:00
Sam Lantinga
d7be7fc168
Fixed Cohen-Sutherland out code computation for float line intersection
...
Fixes https://github.com/libsdl-org/SDL/issues/10866
2024-10-13 13:04:59 -07:00
Sam Lantinga
a8ca024495
Added SDL_GetDefaultLogOutputFunction()
...
Fixes https://github.com/libsdl-org/SDL/issues/10603
Closes https://github.com/libsdl-org/SDL/pull/11106
2024-10-13 12:14:46 -07:00
Sam Lantinga
b766c824bd
Don't overwrite the SDL_IOFromFile() error in SDL_LoadBMP()
...
Fixes https://github.com/libsdl-org/SDL/issues/11188
2024-10-13 09:37:44 -07:00
Sam Lantinga
a567786762
Added SDL_SetErrorV()
2024-10-13 09:26:25 -07:00
capehill
1a1e2e9892
Set size parameter in SDL_GetClipboardData()
...
Update size value in case where platform uses GetClipboardText().
This should fix clipboard_testClipboardDataFunctions on those platforms.
2024-10-13 08:59:50 -07:00
Evan Hemsley
82598e5ca9
GPU Vulkan: Fix frame counter timing ( #11189 )
2024-10-12 22:02:22 -07:00
Anonymous Maarten
b641c2a0db
Refactor gendynapi.py with the final goal to make it re-usable
2024-10-13 02:52:56 +02:00
Anonymous Maarten
173c168ff4
Default functions are already declared by the first SDL_dynapi_procs.h include
2024-10-13 02:52:56 +02:00
Cameron Cawley
fd9e57b71e
3DS: Support simple message boxes
2024-10-12 16:07:52 -07:00
Rusty Moyher
7556c44796
SDL3: Fixed Cocoa_GL_CreateContext() not returning a context on success ( #11181 )
2024-10-12 14:01:21 -07:00
Cameron Cawley
fec006a4f9
Allow for more fine tuning of Duff's device routines
2024-10-12 11:16:46 -07:00
Cameron Cawley
aebb64efa1
Remove leftover ARM SIMD code
2024-10-12 11:13:37 -07:00
Daniel Gibson
9a81892447
Old env vars as fallback for SDL_VIDEO_DRIVER + SDL_AUDIO_DRIVER #11115
...
especially SDL_VIDEODRIVER is commonly used to use the native Wayland
backend, so I think it's a good idea to keep supporting the old name
instead of forcing users to find out that they now have to add an
underscore..
Not sure how popular SDL_AUDIODRIVER is, but with all the audio backends
that exist on Linux alone I'm sure some people use it to work around
sound issues.
Note: Doing this in the SDL_hints implementation instead of the
call-sites of SDL_GetHint(SDL_HINT_VIDEO_DRIVER) etc ensures that
1. Hint priorities work (env var overriding hint set by application with normal
priority, but not when application used SDL_HINT_OVERRIDE)
2. SDL_ResetHint() (called by user code) respects the fallback
environment variable
2024-10-12 08:47:02 -07:00
Cameron Cawley
3e57d996fe
Reduce the size of the SDL_blit_0 alpha code
2024-10-12 08:29:11 -07:00
rhett-lee
22566506d0
SDL3: opengles2 render not support window with transparent flag on Linux/X11 ( #11167 )
2024-10-11 21:59:56 -07:00
Sam Lantinga
c6c195ff88
Always use WaitForSingleObjectEx() as a fallback in SDL_SYS_DelayNS()
...
That logic isn't specific to the Visual Studio build environment. Also switched it to use CreateEvent(), which works back to Windows XP.
2024-10-11 21:18:31 -07:00
Sam Lantinga
c5904d8710
Improved implementation of SDL_DelayPrecise() (thanks @nightmareci!)
...
Fixes https://github.com/libsdl-org/SDL/issues/10592
2024-10-11 21:18:31 -07:00
Sam Lantinga
25251a9405
Fixed warning C4723: potential divide by 0
2024-10-11 19:31:22 -07:00
Sam Lantinga
3cd7e22e8b
Fixed converting full range YUV to RGB
...
Updated from https://kdashg.github.io/misc/colors/from-coeffs.html
I'm not sure where the other formulas came from, but they weren't mathematically correct and resulted in slightly incorrect colors.
2024-10-11 18:12:05 -07:00
Evan Hemsley
6ea4a66451
GPU: Add SDL_CalculateGPUTextureFormatSize ( #11146 )
...
---------
Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2024-10-10 16:34:38 -07:00
Caleb Cornett
3db10a6b2c
GPU: ASTC block size fixes ( #11157 )
2024-10-10 15:40:21 -07:00
Ryan C. Gordon
90a3a2359b
thread: Rewrote generic Condition Variables.
...
This replaces the internal mutex with a semaphore, so we're only using a
single synchronization primitive to implement this, and cleans up some logic
around wait timeouts.
This now matches the logic of the originally cited work, from BeOS.
Fixes #3639 .
(I think.)
2024-10-10 15:03:53 -04:00
Sam Lantinga
73b995fbad
Don't assume OpenGL on Android
...
This prevents Vulkan from initializing by default.
Fixes https://github.com/libsdl-org/SDL/issues/10279
2024-10-10 10:53:31 -07:00
Ozkan Sezer
7ff819141d
libm/e_exp.c: fix gcc warning on 32 bit:
...
src/libm/e_exp.c:105: warning: integer constant is too large for 'long' type
2024-10-10 18:23:20 +03:00
Sam Lantinga
4b7c5f561b
Fixed warning: ‘new_item.probe_len’ may be used uninitialized in this function
2024-10-10 08:06:18 -07:00
Sam Lantinga
c8f5f6d47a
Added SDL_DelayPrecise()
...
SDL_DelayNS() now passes through to the high precision OS delay function, and SDL_DelayPrecise() tries to busy wait to get as close as possible to the desired wait time.
Fixes https://github.com/libsdl-org/SDL/issues/11141
2024-10-10 08:06:18 -07:00
David Gow
9c322386bf
gpu: vulkan: Fix an uninitialised structure in SDL_BlitGPUTexture()
...
The SDL_GPUColorTargetInfo structure needs to be zeroed, as otherwise we
can end up trying to create a resolve_texture which doesn't exist,
causing a rather difficult-to-debug segfault when calling
SDL_BlitGPUTexture() with a load op of SDL_GPU_LOADOP_CLEAR.
2024-10-10 07:16:02 -07:00
Evan Hemsley
da5a1585cd
GPU: Avoid calling SDL_GetWindowSizeInPixels when possible ( #11139 )
2024-10-09 18:59:07 -07:00
Sam Lantinga
9023a199dd
Fixed crash in RLE colorkey blitting
...
Fixes Maelstrom running over sdl2-compat with SDL3
2024-10-09 12:11:21 -07:00
Sam Lantinga
f946f87f30
Don't rely on event.buttonMask being set in touchesEnded
...
Fixes https://github.com/libsdl-org/SDL/issues/11131
2024-10-09 11:35:39 -07:00
Sam Lantinga
ee9b6204cf
Updated to version 3.1.5 for development
...
We should bump the version immediately before and after release so the release version corresponds to a fixed snapshot of code.
2024-10-09 11:02:01 -07:00
Sam Lantinga
f8eac30276
Added SDL_StepBackUTF8()
2024-10-09 09:49:10 -07:00
Sam Lantinga
1f08a03794
Switched drag-n-drop logging to trace level
...
The logging is extremely verbose and covers the entire data exchange process, which is more suited to the trace level.
2024-10-09 07:35:21 -07:00
Daniel Ludwig
5b6342a00d
Default SDL_HINT_JOYSTICK_GAMEINPUT to "1" on GDK platforms
2024-10-09 07:30:13 -07:00
Daniel Ludwig
acb18e05b5
GPU: fix swapchain buffer size not set on Xbox
2024-10-09 07:30:13 -07:00
Sam Lantinga
ff834f7733
Removed the restrict keyword
...
It doesn't compile with older Visual Studio and I verified on godbolt.org that the way it was used here doesn't impact code generation at all.
2024-10-08 20:48:13 -07:00
Delta
8e6ead2f7b
[GPU] Added ASTC texture format support ( #11116 )
2024-10-08 18:45:04 -04:00
Ryan C. Gordon
02434cd293
emscripten: Fixes for data addresses above 2gb
...
This includes both wasm64 and wasm32 when addressing more than 2gb of memory.
Fixes : #9052
(Manually cherry-picked from 3deb07ea395373204462130c1e062bc1f71fe060.)
2024-10-08 17:41:18 -04:00
Ryan C. Gordon
cba77834f2
init: Log '<unspecified>' not '(null)' if the app name isn't set.
...
Reference PR #11103 .
2024-10-08 14:30:55 -04:00
Simon McVittie
fb8244d6d9
init: Also log the SDL revision here
...
This includes the version number, unless the developer is doing
something strange with git tags.
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 14:29:02 -04:00
Simon McVittie
c24f7d2453
Log app ID as SYSTEM/INFO during initialization
...
This is not shown by default, but will be shown when using
SDL_LOGGING=system=info or higher, where it will hopefully nudge app
authors towards initializing this information.
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-08 14:29:02 -04:00
Sam Lantinga
e7ee92e822
Switched drag-n-drop logging to trace level
...
The logging is extremely verbose and covers the entire data exchange process, which is more suited to the trace level.
2024-10-08 10:56:27 -07:00
Sam Lantinga
2000ccb541
Allow linear interpolation of the font textures
...
With the recent changes to logical presentation, this is necessary for the font to look good when scaled.
Fixes https://github.com/libsdl-org/SDL/issues/11123
2024-10-07 21:43:57 -07:00
Sam Lantinga
4627283eca
Allow building both Cocoa and dummy dialog implementations
...
This allows us to remove platformFilters from the Xcode project, which is not supported in Xcode 12.
2024-10-07 18:01:39 -07:00
Sam Lantinga
81b48de3f5
Fixed VID/PID list parsing of SDL_HINT_GAMECONTROLLER_SENSOR_FUSION
...
Fixes https://github.com/libsdl-org/SDL/issues/11118
2024-10-07 16:14:57 -07:00
Sam Lantinga
5db64300b8
Fixed SDL_GetStringInteger() for values starting with '0' and '1' (thanks @DanielGibson!)
2024-10-07 15:53:38 -07:00
Sam Lantinga
7da728a642
Added support for wired XBox controllers on macOS 15.0 Sequoia
...
Fixes https://github.com/libsdl-org/SDL/issues/11002
2024-10-07 15:44:42 -07:00
Ryan C. Gordon
aa534c3ac3
core: Fixed incorrect comment in core/windows/SDL_windows.h.
2024-10-07 16:55:30 -04:00
rabbit-ecl
6ae5666acf
Check for VK_SUBOPTIMAL_KHR also in vkQueuePresentKHR ( #11113 )
...
This is already handled for vkAcquireNextImageKHR.
2024-10-07 13:01:10 -07:00
Sam Lantinga
06bd214af6
Fixed warnings building on Android
2024-10-07 11:11:27 -07:00
Sam Lantinga
65539bc4f7
Make sure trackpad state is updated when button presses are delivered
...
Fixes https://github.com/libsdl-org/SDL/issues/11085
2024-10-06 14:28:06 -07:00
Sam Lantinga
03b259893a
Fixed return value of SDL_AddGamepadMapping()
...
Fixes https://github.com/libsdl-org/SDL/issues/11095
2024-10-06 14:20:30 -07:00
Jan Sedivy
c2b98e21ba
macOS: Add hint for smooth SDL_EVENT_MOUSE_WHEEL values
2024-10-06 12:36:42 -07:00
Frank Praznik
2fa8acb084
x11: Refresh the global cursor coordinates when confining the pointer
...
XGrabPointer can warp the cursor into the window when confining, so set the flag to refresh the global coordinates when queried.
2024-10-06 14:48:24 -04:00
David Fort
e00b1fdd67
clipboard: include mime types in SDL_ClipboarUpdate
...
This patch modifies the clipboard handling so that when we receive an external
clipboard update, the suppported mime types are included in the SDL_ClipboarUpdate
event. The patch also introduces the owner field that allows to know if the update
is because we own the clipboard (internal update) or if it was an external update.
2024-10-05 18:19:10 -07:00
bubbleguuum
2880b40e33
fix pipewire prototype
2024-10-05 18:16:12 -07:00
zshoals
1ca45c5891
Fix typo: DiretMedia->DirectMedia
2024-10-05 00:08:01 -04:00
Sam Lantinga
00385951a1
Use file descriptor I/O for process pipes
...
Use low level non-blocking I/O for process pipe streams. This may fix issues with data not getting through the pipe occasionally.
Related: https://github.com/libsdl-org/SDL/issues/11006
2024-10-04 12:24:17 -07:00
Sam Lantinga
6c64c62114
Rename SDL_BUTTON() to SDL_BUTTON_MASK()
...
Fixes https://github.com/libsdl-org/SDL/issues/11056
2024-10-04 09:13:59 -07:00
Sam Lantinga
fe2880fcda
Rename SDL_SetThreadPriority() to SDL_SetCurrentThreadPriority()
...
Fixes https://github.com/libsdl-org/SDL/issues/11055
2024-10-04 08:57:03 -07:00
Daniel Ludwig
69196ab30d
Change evasive library handle to `SDL_SharedObject*`
2024-10-04 05:18:40 -04:00
Ryan C. Gordon
3a6a3ab64f
gpu: Fix memory leak in Vulkan backend.
2024-10-04 04:46:28 -04:00
Sam Lantinga
43e7ce7dfc
Updated to version 3.1.3 for the preview release
2024-10-03 23:01:55 -07:00
Ryan C. Gordon
9a5d5a2839
video: Improve the EGL attribute callbacks.
...
Now it has access to information it needs and it's clear who is reponsible
for memory management.
Fixes #11039 .
2024-10-03 22:52:52 -07:00
Petar Popovic
d4143e02d1
Always set checked_monotonic_time when calling CheckMonotonicTime()
2024-10-03 17:11:34 -07:00
Petar Popovic
020fb6889c
Removed unnecessary const-qualifiers in src and test files
2024-10-03 17:39:08 -04:00
Petar Popovic
b8e8dcaa9a
Add void to openbsd function prototypes
2024-10-03 13:55:21 -07:00
Petar Popovic
0e909d2785
Removed redundant condition in src/events/SDL_pen.c
2024-10-03 13:42:18 -07:00
Ryan C. Gordon
191f3ecbbc
render: Restore previous policy for converting window/render coordinates.
...
Before this commit, it would adjust for the logical presentation settings.
Now, it works as it did before the logical presentation render target was
removed: it takes current viewport and scale into account, as well.
Fixes #10978 .
2024-10-03 16:31:56 -04:00
Petar Popovic
3246df8bd3
Remove redundant SDL_Vulkan_GetResultString() declaration
2024-10-03 13:29:53 -07:00
Ethan Lee
a0de6c4abf
Add properties to SDL_IOStreams returned by IOFromMem
2024-10-02 22:09:09 -07:00