Commit Graph

10759 Commits

Author SHA1 Message Date
Sam Lantinga 8026866994 wayland: fixed memory leak at shutdown 2024-11-02 22:56:03 -07:00
Sam Lantinga 7031b240df Added SDL_PROP_WINDOW_WAYLAND_VIEWPORT_POINTER 2024-11-02 22:22:29 -07:00
Sam Lantinga 87dade4421 Set SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER for the GPU renderer
Fixes https://github.com/libsdl-org/SDL/issues/11393
2024-11-01 18:38:42 -07:00
Sam Lantinga 927d297161 Updated to version 3.1.7 for development 2024-11-01 15:49:31 -07:00
Sam Lantinga 78cc5c1734 Updated to version 3.1.6 for the preview release 2024-11-01 14:27:01 -07:00
Sam Lantinga c5f12b135d Fixed the D-pad on wireless Xbox 360 controllers 2024-11-01 09:02:55 -07:00
Sam Lantinga 8b48b70c6e Fixed return value setting state on combined Joy-Con controllers 2024-10-31 20:37:23 -07:00
expikr e2857fc5a2 Update SDL_mouse.c 2024-10-30 12:01:51 -07:00
Maia 5699ba799e Add return to CHECK_VULKAN_ERROR_AND_RETURN macro 2024-10-30 11:52:42 -07:00
Sam Lantinga 09495059df Fixed the PS5 controller face buttons on Amazon Fire TV, Android 11 2024-10-30 05:23:00 -07:00
Sam Lantinga c099d0525e sort_controllers.py: fixed parsing SDL_PRIVATE_GAMEPAD_DEFINITIONS 2024-10-30 05:21:59 -07:00
M. P. Halpin 24bdbb8bf4 Supress Metal warning when compiling against macOS 10.11-10.13 2024-10-29 20:03:18 -07:00
Sam Lantinga 51628034d9 Don't offset the view if there's no text input rect
Otherwise this will shift the entire view upwards, which probably isn't what you want.
2024-10-29 16:42:16 -07:00
Sam Lantinga c8a04eec06 Autorelease keys should go down when pressed. 2024-10-29 16:24:40 -07:00
Evan Hemsley b4dff42dcd
GPU: Add SDL_CancelGPUCommandBuffer (#11316)
---------

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
2024-10-29 14:43:22 -07:00
cosmonaut 014b473bcc GPU D3D12: Fix depth texture sampling 2024-10-29 12:05:35 -07:00
cosmonaut ff14a1781f GPU D3D12: Fix indirect buffers not being refcounted 2024-10-29 10:34:54 -07:00
d-musique 35e53f76a9
metal: check success of device creation (#11367)
When macOS runs under a virtual environment, it is possible that
MTLCreateSystemDefaultDevice() does not succeed.
Not checking this failure results in a crash down the road.
This change allows to skip GPU renderer and use an adequate fallback.

Co-authored-by: D.musique <d-musique@users.noreply.github.com>
2024-10-29 12:35:13 -04:00
Caleb Cornett 54836050c9 metal: Add availability checks 2024-10-29 08:13:51 -07:00
Frank Praznik 8f9a562969
wayland: Remove vestigial struct member 2024-10-29 10:51:18 -04:00
Frank Praznik 36c209080c wayland: Refactor some shell surface related names 2024-10-28 14:30:08 -04:00
Frank Praznik 2b7dc55364 wayland: Check the WM capabilities before sending a minimize event
Wayland gives no feedback to windows regarding whether a minimize request was successful, so we would universally send the minimize event and assume that the request succeeded.

Check the window manager capabilities, if available, for whether window minimization is supported, and don't send the minimized event in the case that it is unsupported.
2024-10-28 14:30:08 -04:00
Frank Praznik 1abbd13414 wayland: Throttle interactive user resize events
Excessive resize events generated during interactive window resizing can cause applications to lag, severely in some cases. Throttle interactive resize events to once per frame callback interval.
2024-10-28 14:30:08 -04:00
Petar Popovic cb0c7c9680 SDL_CreateDirectory(): directory tree creation for absolute paths for non-Windows platforms 2024-10-28 01:56:48 -04:00
Petar Popovic a10578acbd SDL_SYS_RenamePath(): Fix error message. 2024-10-27 16:54:13 -07:00
Petar Popovic 8468c372b2 SDL_EnumerateDirectory(): (posix) Fix return value when directory is invalid 2024-10-25 22:52:56 -07:00
Dan Ginsburg 4f160d69a6 Closes #10318 - implement Android prerotation in the Vulkan renderer 2024-10-25 14:21:29 -07:00
Ozkan Sezer 93471cf78d video/openvr: minor clean-up:
- make all of function pointers static
- make EGLint context_attribs[] static
- comment out unused function pointer ov_wglGetCurrentContext
- remove unused SDL_DisplayMode openvr_dm_default
- move SDL_VideoDisplay openvr_vd_default to OPENVR_VideoInit()
  context and eliminate its C99 initializers
- replace atoi() calls with SDL_atoi()
- replace atof() calls with SDL_atof()
2024-10-25 23:20:24 +03:00
Ryan C. Gordon 344546b4ea cocoa: Make sure GL context destruction happens on the main thread.
Fixes #10900.
2024-10-24 16:27:58 -04:00
Ryan C. Gordon 8d3bec99a7
audio: Make SDL_GetAudioStreamProperties() thread safe. 2024-10-24 14:37:23 -04:00
Frank Praznik 731853077a
Send drop complete events when the drop leaves the window on Cocoa, Wayland, and X11
This is already done on win32, however, other platforms were left in a state of limbo if a drop operation began, then never completed due to the drop leaving the window.
2024-10-24 13:36:24 -04:00
Ryan C. Gordon 4ea26a7771
emscripten: scale mousewheel X coordinates correctly, not just Y coordinates.
Fixes #10454.
2024-10-23 23:35:02 -04:00
Ryan C. Gordon 7108291d0b video: Change SDL_GLattr to SDL_GLAttr. 2024-10-23 18:50:52 -04:00
Frank Praznik 924f719b97
wayland: Get the window content scale from the backend
The window content scale may change independently of the display it is on if scaling or accessibility features are involved, so query it directly from the backend instead of inferring it.
2024-10-23 15:49:26 -04:00
kyle-sylvestre 22bc430bbb Set error using function hresult 2024-10-23 10:53:46 -07:00
Sam Lantinga 6eca02a0e7 evdev: correctly handle composite devices
These can be both mouse and keyboard and should be initialized and exposed to the application as both.
2024-10-23 10:52:50 -07:00
Sam Lantinga ba1412cb9f evdev: fixed devices not being removed on disconnect 2024-10-23 10:52:00 -07:00
Evan Hemsley 423337796c
GPU Vulkan: Use dedicated allocation for download buffers (#11298) 2024-10-23 09:37:06 -07:00
Ivan Epifanov 1f8b9a320c VITA: fix SDL_ShowMessageBox by using different memory type 2024-10-22 12:19:33 -07:00
Anonymous Maarten 0bec18245d android: fix android.content.Context:getCacheDir JNI prototype 2024-10-22 18:03:34 +02:00
Ryan C. Gordon e61f0678ee
x11: Remove the "safety net" error handler.
This is an X11 error catcher that lived for the entire life of the program,
which causes problems in itself, but it also tries to make calls into Xlib,
which would cause further panics.

It's goal was to reset video modes if the app was going down, but it often
failed to do so, and caused potentially avoidable crashes instead.

Fixes #7975.
2024-10-22 10:41:30 -04:00
Sam Lantinga c56af0d975 Removed unused code 2024-10-21 17:26:14 -07:00
Sam Lantinga 35be8bb7f9 Fixed warning C4456: declaration of 'e' hides previous local declaration
This also fixes incorrect interpretation of OPENVR_SetupJoystckBasedOnLoadedActionManifest() return value.
2024-10-21 15:53:47 -07:00
Emmanuele Bassi 8119568805 x11: Remove text-scaling-factor setting checks
The text-scaling-factor setting is not useful, now that we watch the
Xft/DPI and Gdk/WindowScalingFactor XSETTINGS keys; on the contrary, it
is problematic in mixed environments with both the KDE and GNOME
portals, as they end up stepping on each other's toes, and we end up
with the wrong scaling factor value.

Fixes: https://github.com/libsdl-org/SDL/issues/11142
2024-10-21 15:26:22 -07:00
Sam Lantinga 1c51b8dc33 Only set the OpenGL flag if the OpenVR driver is active 2024-10-21 15:22:56 -07:00
Sam Lantinga 82b3325978 Fixed memory leaks if Windows initialization fails 2024-10-21 15:22:56 -07:00
Sam Lantinga d199586683 Fixed memory leaks if OpenVR initialization fails 2024-10-21 15:22:56 -07:00
Sam Lantinga 0aea14cf45 Added logging for additional events 2024-10-21 14:23:29 -07:00
Sam Lantinga 3d47877bb4 Added SDL_EVENT_RENDER_DEVICE_LOST
This is sent when the device is lost and can't be recovered.

Also fixed the vulkan renderer so it returns errors appropriately and will log and break if debug mode is enabled.
2024-10-21 13:28:40 -07:00
Sam Lantinga 26567df878 Don't treat mouse buttons as focus clicks if the window has mouse capture
This fixes the following sequence:
* Press mouse button down
* Alt-tab away from the window
* Alt-tab back to the window
* Release mouse button

Fixes https://github.com/libsdl-org/SDL/issues/7747
2024-10-21 09:46:07 -07:00
Ryan C. Gordon ef758d05c1
render: GetRenderViewportSize shouldn't use scale, just logical presentation.
Fixes #11076.
2024-10-21 11:17:16 -04:00
Sam Lantinga 92520c1d9b Improved D3D12 handling of unrecoverable device loss 2024-10-21 00:38:42 -07:00
Sam Lantinga 315842cf71 Fixed crashes handling D3D11/12 device lost in testsprite
You can test this using "dxcap -forcetdr"
2024-10-21 00:29:18 -07:00
Sam Lantinga e2254b1045 Added color scale info for the GPU renderer TODO item 2024-10-20 18:38:02 -07:00
mausimus a6536a9298 RI_KEY_BREAK indicates key is up 2024-10-20 10:26:07 -07:00
rhett-lee e0321ca5b6
SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11 (Bug #11273) (#11274)
SDL3: SDL_render_gl(render name: opengl) dose not support transparent on Linux/X11:

Create SDL window with SDL_WINDOW_TRANSPARENT flag;
Create "opengl" renderer for the window;
The window can't shown with errors:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 130 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Bug reason:
SDL_x11window.c:490 : bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
SDL_x11window.c:566 : vinfo = X11_GL_GetVisual(_this, display, screen, transparent);[XVisualInfo *vinfo]
the X11_GL_GetVisual function returns a vinfo dose not support transparent.

Fix:
SDL_x11opengl.c:637 : XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, bool transparent)
X11_GL_GetVisual should returns a vinfo support transparent when transparent is true.
2024-10-19 20:21:50 -07:00
Sam Lantinga dcbb2f11a8 Clamp the texture alpha and color modulation values to 0-255 2024-10-19 20:18:57 -07:00
Cameron Cawley 40070d899d Refactor Blit_RGB555_ARGB1555 to be more generic 2024-10-19 11:11:22 -07:00
Ozkan Sezer 3d2c8c510d add GLES3 headers from Khronos for OpenVR video driver. 2024-10-19 10:23:55 -07:00
Sam Lantinga 153f90a725 Revert "Use the correct return type for SDL_GetAndroidJNIEnv()"
This reverts commit 2d3fa03d53.

Different JDK implementations define JNIEnv differently for C++, so we can't provide the definition here.

Fixes:
/usr/lib/jvm/temurin-11-jdk-amd64/include/jni.h:195:17: error: conflicting declaration ‘typedef struct JNIEnv_ JNIEnv’
/home/runner/work/sdlwiki/sdlwiki/.github/../external/SDL3/include/SDL3/SDL_system.h:266:24: note: previous declaration as ‘typedef struct _JNIEnv JNIEnv’
2024-10-19 10:20:50 -07:00
Sam Lantinga ffb1d9e4b4 Removed Blit2101010toN and BlitNto2101010
10-bit RGB formats are typically used with the PQ colorspace, which is handled by SDL_Blit_Slow.

Fixes https://github.com/libsdl-org/SDL/issues/11271
2024-10-19 10:07:53 -07:00
华仔 5c1ccaefae Fixed VULKAN_UpdateViewport judgment. 2024-10-19 09:51:12 -07:00
Frank Praznik 4c2d0c422b
wayland: Remove kde_output_order_v1 support
This protocol is unstable and not intended for clients, and SDL now sorts the display list into a stable order and selects a primary display suitable for games on its own, so it isn't necessary.

Reverts e71e16950a
2024-10-19 11:16:30 -04:00
Ryan C. Gordon b6a6a4a7f8
audio: fix incorrect dynCall in Emscripten audio.
This only seemed to cause problems with `-s ASYNCIFY` on the build command
line, but it was incorrect in general.

Fixes #11258.
2024-10-18 23:53:40 -04:00
Sam Lantinga 07bb8f1c4c openvr: added APIENTRY for OpenGL functions (thanks @cnlohr!) 2024-10-18 16:40:36 -07:00
Sam Lantinga b40ad5428b Fixed assertion at quit when the debug text was the last texture used. 2024-10-18 14:51:40 -07:00
Sam Lantinga 1d23d2c3c2 Renamed SDL_SANDBOX_UNKNOWN to SDL_SANDBOX_UNKNOWN_CONTAINER 2024-10-18 12:45:07 -07:00
Frank Praznik a7da3ad59b x11: Support sorting displays via the priority hint
Store the connector name for displays and use it for sorting them according to priority, if the hint is set.
2024-10-18 13:09:08 -04:00
Frank Praznik 0faf9dc4a4 kmsdrm: Support sorting displays via the priority hint
Use the connector name for displays and sort them according to priority, if the hint is set.
2024-10-18 13:09:08 -04:00
Ozkan Sezer a6e5ab437f video/openvr: Avoid type redefinition errors.
Also, let SDL handle stdint.h and stdbool.h.
2024-10-18 19:21:32 +03:00
Sam Lantinga e81e917c5e Added an OpenVR video driver (thanks @cnlohr!) 2024-10-17 19:38:04 -07:00
Ozkan Sezer 569691797d windows/SDL_systhread.c: fix permissions 2024-10-18 05:00:04 +03:00
Sasha Szpakowski 186c6e5c9d windows: fix race condition with exception-based thread naming. 2024-10-17 18:42:01 -07:00
Sam Lantinga faa404a652 If we get a newline character, treat it as SDLK_RETURN
Fixes https://github.com/libsdl-org/SDL/issues/10679
2024-10-17 18:18:38 -07:00
Sam Lantinga a432abf4cc Make sure that we quit if we get a terminating event
This covers the case where the application didn't handle the quit or terminating event, we still need the main loop to finish.
2024-10-17 17:19:49 -07:00
Sam Lantinga c5e1ae4580 Only free debug_char_texture_atlas if it has been allocated
Fixes https://github.com/libsdl-org/SDL/issues/11254
2024-10-17 17:19:49 -07:00
Sam Lantinga 00f4cb308b Fixed crash if the Vulkan renderer changes swapchain image count 2024-10-17 17:19:49 -07:00
Sam Lantinga 41366f73b2 Don't block in Android USB device open
We might be waiting a long time for a permissions dialog, so let that complete asynchronously. While that's happening, we'll remove the device from the device list so that when we get permission the application sees the device as newly available and can open it again.

Fixes https://github.com/libsdl-org/SDL/issues/6347
2024-10-17 12:02:24 -07:00
Sam Lantinga 60c3eaf5ee Use SDL_GetAndroidJNIEnv() in hid.cpp 2024-10-17 12:02:24 -07:00
Sam Lantinga 2d3fa03d53 Use the correct return type for SDL_GetAndroidJNIEnv()
This prevents application code from having to cast to JNIEnv everywhere.
2024-10-17 12:02:24 -07:00
Sam Lantinga 3d852da806 Requesting Bluetooth permission on Android is now asynchronous
This fixes an ANR at startup if gamepad input comes in while prompting for Bluetooth permissions.

Fixes https://github.com/libsdl-org/SDL/issues/6347
2024-10-17 12:02:24 -07:00
Sam Lantinga be3d961b47 Treat clicking the right pad as a thumbstick click on a Steam Controller 2024-10-17 12:02:24 -07:00
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