Commit Graph

6464 Commits (04bcc910e914b75fcebebf11c3b09d065673af8a)

Author SHA1 Message Date
Pierre Wendling 5ddac7e026 PSP: Fix type mismatch warnings. 2022-10-10 22:31:16 -07:00
Pierre Wendling c1317175b4 PSP: Fix `Wformat` warnings. 2022-10-10 22:31:16 -07:00
Pierre Wendling 669532d529 PSP: Remove dead code.
Fixes unused variable warning.
2022-10-10 22:31:16 -07:00
Ryan C. Gordon 17322e2be6
dynapi: Optionally log every call into the SDL API.
This will only log things going through dynapi, which means it won't
do anything if dynapi is disabled for a given build, but also things
that call the `*_REAL` version of an API won't log either (which is
to say, if an internal piece of SDL calls a public API, it won't log
it, but if an application calls that same entry point, it will).

Since this just inserts a different function pointer, unless you
explicitly request this at runtime, it won't add any overhead, and,
of course, the entire thing can be turned off with a single #define
so it doesn't even add extra unused code to the shared library if
the kill switch is flipped.
2022-10-10 13:17:07 -04:00
Sam Lantinga 4507083503 Fixed build 2022-10-10 09:39:55 -07:00
Sam Lantinga 680d0f043a Added support for undefined or centered position for shaped windows
Fixes https://github.com/libsdl-org/SDL/issues/6359
2022-10-10 09:27:26 -07:00
Pierre Wendling 43a2b0b1e5 N3DS: Use macro to correct axis.
Using `(value * SDL max) / 3DS max` allows for marginally better
accuracy compared to `value * (SDL max / 3DS max)`.
2022-10-10 08:50:59 -07:00
Pierre Wendling 49c25b1daf N3DS: Fix PrivateSensorUpdate call.
A new timestamp parameter was added in 2c51874.
2022-10-10 08:50:59 -07:00
Pierre Wendling cb1972b3ba N3DS: ZL and ZR should be considered as triggers.
Previously they were considered as clicking stick.
2022-10-10 08:50:59 -07:00
Pierre Wendling 86a8714fea N3DS: Refactor joystick module to avoid globals. 2022-10-10 08:50:59 -07:00
Pierre Wendling 392f3882d0 N3DS: Use SDL_Sensor instead of Joystick sensors. 2022-10-10 08:50:59 -07:00
Pierre Wendling efc93e6851 N3DS: Don't set `num_display` by hand.
Doing so creates 2 empty displays at the beginning of the list.
2022-10-10 08:50:59 -07:00
Pierre Wendling 83ec6062af N3DS: Move gfxInit and hidInit from main to video. 2022-10-10 08:50:59 -07:00
Pierre Wendling 266014faa7 N3DS: Use SDL_Touch instead of the Joystick touch. 2022-10-10 08:50:59 -07:00
Pierre Wendling f9785702a6 N3DS: Deduce screen from window's display.
This removes the need for a dedicated window creation flag.
2022-10-10 08:50:59 -07:00
Pierre Wendling 46a13ad97a N3DS: NEON is likely not supported. 2022-10-10 08:50:59 -07:00
Pierre Wendling af2bc2ed0e N3DS: Use osSetSpeedupEnable instead of PTMSYSM. 2022-10-10 08:50:59 -07:00
Pierre Wendling 03bbbcd85e N3DS: Use CreateJoystickGUIDForName. 2022-10-10 08:50:59 -07:00
Pierre Wendling 2b2693ae90 N3DS: Use asprintf instead of snprintf. 2022-10-10 08:50:59 -07:00
Pierre Wendling 655275378d N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
2022-10-10 08:50:59 -07:00
Sam Lantinga 61b5360e17 Only check to see if the ICC profile changes when the display changes or we gain focus
Fixes https://github.com/libsdl-org/SDL/issues/6366
2022-10-10 08:29:05 -07:00
Sam Lantinga f99fc3268e d3d12: fixed window resize handling
Fixes https://github.com/libsdl-org/SDL/issues/6355
2022-10-09 11:42:39 -07:00
Sam Lantinga 490c20f93f d3d12: reset the vertex buffer size when it is released 2022-10-09 09:57:55 -07:00
Sam Lantinga efdb390caa Disable the HIDAPI Wii driver by default as it doesn't work with the dolphinbar 2022-10-09 09:11:33 -07:00
Frank Praznik 6391ad970c wayland: Factor out common libdecor frame commit code
The pattern of:
 libdecor_state_new()
 libdecor_frame_commit()
 libdecor_state_free()

 was used in several places. Factor it out into a common function.
2022-10-09 08:50:54 -07:00
Frank Praznik b0a9396b00 wayland: Remove XDG surface geometry calls
These were needed to fix some buggy behavior regarding committing old buffer sizes when entering fullscreen that has since been corrected. Remove them.
2022-10-09 08:50:54 -07:00
Guldoman b91ddbc3e2 wayland: null-terminate drop data 2022-10-09 08:48:34 -07:00
Anonymous Maarten eb8eb621b1 SDL_x11modes: fix -Wunused-variable 2022-10-08 23:41:07 +02:00
Anonymous Maarten 01498d3acf SDL_render_psp.c: fix -Wshadow
Emitted by PSP's gcc
2022-10-08 23:41:07 +02:00
Anonymous Maarten 4298e79887 SDL_offscreenframebuffer.c: fix format '%d' expecting int instead of Uint32
Emitted by Nintendo 3DS's gcc (fix is same as used by ngage)
2022-10-08 23:41:07 +02:00
Anonymous Maarten b51a88a95c SDL_malloc.c: fix variable 'used' set but not used
Emitted by clang-cl
2022-10-08 23:41:07 +02:00
Anonymous Maarten 5c150ddc2f SDL_mslibc.c: fix unknown pragma ignored [-Wunknown-pragmas]
Emitted by clang-cl
2022-10-08 23:41:07 +02:00
Anonymous Maarten 85fd40fafd Fix -Wunused-const-variable warning when using clang-cl 2022-10-08 23:41:07 +02:00
Anonymous Maarten 2105c7f6ed SDL_thread.c: fix unused function SDL_FreeErrBuf when building without thread support (emscripten) 2022-10-08 23:41:07 +02:00
Sam Lantinga b18c361b0f Updated variable name for mouse coordinates in mouse wheel events 2022-10-08 13:18:00 -07:00
Sam Lantinga 4f318c904a Add cursor position to mouse wheel event (thanks @meyraud705!)
Fixes https://github.com/libsdl-org/SDL/pull/6351
2022-10-08 12:01:42 -07:00
Sam Lantinga 17b43b0fdd Don't try to create a semaphore for the mutex implementation if threads are disabled
Fixes https://github.com/libsdl-org/SDL/issues/6344
2022-10-08 09:32:09 -07:00
Sam Lantinga 33050fea39 Only open HID devices that might have a HIDAPI driver available
This prevents an OS prompt for every connected device when running on Android
2022-10-07 11:29:49 -07:00
Nicolas Cian 484d5fd6cf audio open: ensure 2 devices don't get the same id 2022-10-07 06:45:01 -07:00
Sam Lantinga fc720321b3 Fix rare deadlock when opening a HID controller on Android
Fixes https://github.com/libsdl-org/SDL/issues/6347
2022-10-06 18:23:07 -07:00
Sam Lantinga 689409fd97 Fixed the start button on the Nimbus+ controller on tvOS
Also updated mappings for Nintendo Switch controllers on tvOS, to reflect the lack of guide/menu button availability
2022-10-06 17:34:24 -07:00
Frank Praznik 914a65e098 wayland: Don't unset min/max values when entering fullscreen via a compositor event
If the compositor is entering fullscreen and hasn't removed any constraints itself, it's already too late at this point.  Remove the unnecessary call.

Restoring the limits when exiting fullscreen is still required, though, as they may have been removed when entering fullscreen via an SDL request.
2022-10-06 14:00:36 -04:00
Frank Praznik 69cf5fb0e1 wayland: Remove surface type helpers
These were remnants of a time before the surface type was explicitly stored, so they can be removed per the TODO note.
2022-10-06 14:00:36 -04:00
Frank Praznik c2b0c41c0a wayland: Set/unset the opaque regions on surfaces when transparency is toggled
Caches the SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY hint at init time and registers a callback, which is fired when the hint is changed during runtime and toggles the opaque region for existing surfaces.
2022-10-06 14:00:36 -04:00
Frank Praznik ea5958009c wayland: Set the damage buffer size when supported
The preferred method for setting the damage region on compositor protocol versions 4 and above is to use wl_surface.damage_buffer. Use this when available and only fall back to wl_surface.damage on older versions.

Bumps the highest supported version of wl_compositor to version 4.
2022-10-06 14:00:36 -04:00
Frank Praznik a8cb7bbe2f wayland: Add dedupe logic to window geometry configuration
Adds deduplication logic to ConfigureWindowGeometry() to avoid setting redundant backbuffer, viewport and surface opaque region dimensions. State is now only set when the window and/or backbuffer dimensions change.

This repurposes the viewport rect to always hold the actual size of the window, which can differ from the SDL size if things are being scaled. The SDL_Rect was removed in favor of two ints, as the x/y members of the struct were never used, so they just wasted space.

Since the internal variables always have the true window size, the width/height getter functions are no longer required and can be removed.
2022-10-06 14:00:36 -04:00
slime d2160c29d1 iOS: implement SDL_GetWindowSizeInPixels. 2022-10-05 18:39:18 -07:00
Sam Lantinga ddc3de602e Added mapping for PS5 controller over Bluetooth on Android 12
Tested on Pixel 3a
2022-10-05 16:24:05 -07:00
Sam Lantinga 81afb3e303 Need to swap endianness when extracting the CRC from game controller mappings 2022-10-05 16:18:42 -07:00
Andrey Filipenkov 92c71ae385 [iOS] respect initial status bar configuration when displaying the launch storyboard 2022-10-05 13:30:19 -07:00
Andrey Filipenkov 5b13136471 [UIKit] handle app lifecycle events in a custom object instead of AppDelegate
removes the need to call SDL counterparts manually when custom AppDelegate is used
2022-10-05 13:28:55 -07:00
daniel e41942e814 fix compilation error SDL_coreaudio mixing declarations and code 2022-10-04 21:04:45 -07:00
Sylvain fdef96e233
Android: remove "nativeSetComposingText" since it's not used anymore
(and it may fail registering at init if code is cleaned with proguard)
2022-10-04 12:08:09 +02:00
Sylvain eac3d6d3c0
SDL_video.c: fix variable 'i' may be uninitialized when used here "_this->name = bootstrap[i]->name;" 2022-10-04 10:46:42 +02:00
David Gow ad29875ee6 Wayland: Emulate mouse warp using relative mouse mode
Several games (including Source and GoldSrc games, and Bioshock
Infinite) attempt to "fake" relative mouse mode by repeatedly warping
the cursor to the centre of the screen. Since mouse warping is not
supported under Wayland, the viewport ends up "stuck" in a rectangular
area.

Detect this case (mouse warp while the cursor is not visible), and
enable relative mouse mode, which tracks the cursor position
independently, and so can Warp successfully.

This is behind the SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP hint, which
is enabled by default, unless the application enables relative mouse
mode itself using SDL_SetRelativeMouseMode(SDL_TRUE).

Note that there is a behavoural difference, in that relative mouse mode
typically doesn't take mouse accelleration into account, but the
repeated-warping technique does, so mouse movement can seem very slow
with this (unless the game has its own mouse accelleration option, such
as in Portal 2).
2022-10-03 19:11:18 -07:00
Sam Lantinga 9e3c4b9f32 Use the correct platform defines 2022-10-03 17:50:01 -07:00
Sam Lantinga 5291e5cb76 Added version checking to SDLActivity.java
Make sure the SDL java and C code match when updating SDL in a game.
Right now we're assuming that we only have to make sure release versions match. We can extend the version string with an interface version if we need more fine grained sanity checking.

Fixes https://github.com/libsdl-org/SDL/issues/1540
2022-10-03 17:36:17 -07:00
Sam Lantinga 3607f8316f Find out if a controller is wireless using WGI (thanks @DJm00n!)
Confirmed using an Xbox Series X controller over USB and Bluetooth

Fixes https://github.com/libsdl-org/SDL/issues/6322
2022-10-03 11:02:23 -07:00
Ryan C. Gordon 321ca1091d
opengles2: Texture names are GLuint, not GLenum. 2022-10-03 12:00:38 -04:00
Ryan C. Gordon 01c5554f0e
opengles2: SDL_GL_BindTexture() should bind all YUV textures.
This matches what the non-GLES OpenGL renderer does.

Fixes #6070.
2022-10-03 11:57:10 -04:00
slime f8f562dace iOS: remove dead pre-iOS 8 codepaths.
SDL hasn't supported those older iOS versions for a little while now.
2022-10-02 19:57:46 -07:00
slime bbeacd72c4 Fix some credit comments. 2022-10-02 19:32:36 -07:00
Sam Lantinga cf331ef3f9 Fixed build 2022-10-02 17:25:43 -07:00
Sam Lantinga 64ea6cefaf SDL_ResetHint() no longer clears the callbacks associated with a hint
Also added SDL_ResetHints() to reset all callbacks, and clarified that SDL_ClearHints() is just used for cleanup at shutdown.

Fixes https://github.com/libsdl-org/SDL/issues/6313
2022-10-02 17:17:31 -07:00
Sam Lantinga bd6afc2317 Fixed sensor axes in vertical mode 2022-10-02 10:15:39 -07:00
Sam Lantinga b4c25f5714 Remapped the side button and trigger as paddles for the mini-gamepad mode of the Joy-Cons
This is the only case where the mapping differs between right and left Joy-Cons in mini-gamepad mode. The left Joy-Con will have the left paddles and the right Joy-Con will have the right paddles. This facilitates co-op gameplay with individual actions while still using the normal mini-gamepad mode.

The paddles are used for this because conceptually they are more awkward to hit than the normal controls and they are in roughly the correct hand position.
2022-10-02 09:51:05 -07:00
Sam Lantinga f58a6506a1 Added paddle mapping for combined Joy-Cons 2022-10-02 09:50:27 -07:00
Sam Lantinga 37dfa2629b Added paddle mapping for combined Joy-Cons 2022-10-02 09:36:50 -07:00
Happy Harry 6c8bf3af4c
Add vertical mode for Nintendo Joy-Con (#6303)
* Added support for vertical mode for Joy-Con controllers
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS for switching to this mode
* Added support for SL/SR buttons in combined/vertical mode and L/ZL/R/ZR buttons in mini-gamepad mode
2022-10-02 09:19:34 -07:00
Sam Lantinga 0672dc8d8f Fixed combined Joy-Cons after aa2e2f4843 (thanks @happyharryh!) 2022-10-02 08:50:11 -07:00
Aaron Barany 5e654a4bf2 Fixed Mac compile errors when OpenGL is disabled. 2022-10-01 18:09:11 -07:00
Sam Lantinga 28572702bf Properly backspace over text that was entered when autocorrect updates text with the iPhone on-screen keyboard 2022-09-30 17:25:57 -07:00
Ryan C. Gordon e6640ef2d4 coreaudio: Possibly fixed another shutdown race condition.
Reference Issue #6159.
2022-09-30 14:53:49 -04:00
Sam Clegg cfab203f91 emscripten: Remove use of EM_ASM from SDL_timer code.
Instead use the native emscripten timer API.

See https://github.com/emscripten-core/emscripten/issues/17941
2022-09-30 13:41:41 -04:00
Jarod Hillman 40893821f2 coreaudio: Add support for SDL_GetDefaultAudioInfo (#6277)
Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2022-09-29 10:33:07 -04:00
zll 69bbe4ce7d Fix memory leak in VITA_GXM_CreateRenderer 2022-09-29 14:32:56 +03:00
Frank Praznik e17f0c283c wayland: Call the Wayland hide/show functions directly when changing decoration modes
Calling SDL_HideWindow() to destroy the window is a NOP if the SDL_WINDOW_SHOWN flag was never set. Bypass it and call the Wayland-specific function directly to ensure that the window is always destroyed before switching from server-side to client-side decorations, even if it hasn't been shown yet.

Likewise, call Wayland_ShowWindow() directly when the window isn't explicitly hidden to ensure that it is always recreated since the SDL_WINDOW_SHOWN flag won't be cleared, which, when set, renders SDL_ShowWindow() a NOP.
2022-09-28 13:21:10 -07:00
Ozkan Sezer 8bcbdc706c hidapi, libusb: backport read_thread indefinite loop fix from mainstream
Mainstream commit:
5ce9051e2f
2022-09-28 08:26:08 -07:00
Ludovico de Nittis 379d478055 dbus: guard against uninitialized D-Bus
Before calling any D-Bus related methods we should first ensure that
they
were correctly loaded.

In the event where `LoadDBUSLibrary()` was not able to load the D-Bus
library, we should just return early, signalling with SDL_FALSE that we
were unable to inhibit the Screensaver.

Helps: https://github.com/ValveSoftware/steam-for-linux/issues/8815

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2022-09-28 10:29:55 -04:00
Eric Curtin 57b5c9107e kmsdrm: only negative devindex's are not allowed
ad874536 removed an unnecessary limit as we *can* have a devindex
greater than 99, this error message does not reflect the support for
values greater than 99.
2022-09-28 10:29:02 -04:00
Ryan C. Gordon f6565c329b
coreaudio: Remove redundant variable. 2022-09-28 09:27:45 -04:00
Ryan C. Gordon 411582c710
coreaudio: Don't crash on shutdown in a race condition.
Fixed #6159.
2022-09-28 09:22:17 -04:00
Sam Lantinga bb74af1e11 Allow including SDL_uikit_main.c in Apple multi-platform builds
This file just won't do anything on macOS
2022-09-28 00:01:54 -07:00
Ryan C. Gordon a2c5757356
video: check for "software" with SDL_HINT_FRAMEBUFFER_ACCELERATION.
We check for this value elsewhere but not in SDL_CreateWindowFramebuffer.
2022-09-27 22:04:06 -04:00
Sam Lantinga 7becbd7d42 Add joystick locking for controller notifications on iOS/tvOS
Fixes https://github.com/libsdl-org/SDL/issues/6288
2022-09-27 12:58:16 -07:00
Sam Lantinga 18eb319adc Added sensor timestamp for Nintendo Switch controllers 2022-09-27 12:34:03 -07:00
Sam Lantinga 5e3a40309e Added sensor timestamp for Steam Controllers 2022-09-27 11:36:01 -07:00
Ryan C. Gordon 57b20e7b9e cocoa: Fix new windows setting SDL_WINDOW_BORDERLESS flag incorrectly.
Fixes #6172.
2022-09-27 14:23:42 -04:00
Ozkan Sezer 77c7836c26 fix vita build failure after commit 2c518747b 2022-09-27 20:21:24 +03:00
Sam Lantinga 2c518747b9 Added microsecond timestamp to sensor values for PS4 and PS5 controllers using the HIDAPI driver 2022-09-27 09:56:49 -07:00
Sylvain d71df6448b
Fixed bug #6287 - SDL_FillRect failed for SDL_Surface with BitsPerPixel == 4 2022-09-27 10:21:15 +02:00
Sam Lantinga 1e1be0b954 Updated logic to match between PS4/PS5/Switch controllers 2022-09-26 23:00:58 -07:00
Sam Lantinga 8c40a6b0c7 Drop PS5 Bluetooth reports that fail CRC check 2022-09-26 22:47:21 -07:00
Sam Lantinga db075ff3ba Removed unused variable 2022-09-26 22:45:01 -07:00
Sam Lantinga 2ccdd0667a Handle DS4 dongle controller connection and disconnection
We also drop Bluetooth packets that fail the CRC check, as recommended by Sony
2022-09-26 22:34:33 -07:00
Sam Lantinga 18046b9aa3 Fixed crash with a NULL serial number 2022-09-26 20:53:50 -07:00
Sam Lantinga 67fa6a935f Don't wait a long time for zombie Bluetooth controllers
If a Nintendo Switch Pro controller is turned off, it will leave the controller connected in Windows, but not responding to reports. Don't wait a really long time trying to get information from a controller in this state.
2022-09-26 20:49:26 -07:00
Sam Lantinga 67db8a9103 Wait for input before reconnecting a Bluetooth device
On Windows, the Bluetooth device can remain in a connected state if the controller just shut down. It won't return any errors, but it also won't generate any input reports in this state, so wait until we know for sure that the Bluetooth controller is sending data before letting the application know it's available.
2022-09-26 20:43:46 -07:00
Cameron Gutman 71fb91f7e4 evdev: Fix build with libudev and joystick subsystem disabled 2022-09-26 21:38:09 -05:00
Sam Lantinga 2cc9176137 Removed debug logging 2022-09-26 18:52:26 -07:00
Sam Lantinga 2c98c8af01 Use better default values for Switch controller calibration 2022-09-26 18:39:47 -07:00
Sam Lantinga a205c5e26c Use separate extents for simple and advanced reports 2022-09-26 18:39:47 -07:00
Sam Lantinga 4e375996d3 Added a hint to return the version in the old format
Workaround for https://github.com/libsdl-org/SDL/issues/6177 for games that can't be updated.
2022-09-26 17:06:18 -07:00
Sam Lantinga b7fddb4c0e Minor tweaks 2022-09-26 14:39:51 -07:00
Sam Lantinga 39adcc0a6b Prefer USB input over Bluetooth for PS5/PS5/Switch controllers
Nintendo Switch controllers will automatically turn off Bluetooth when connected over USB, but this takes care of that a little more quickly.

PS4 and PS5 controllers will happily send reports over both Bluetooth and USB, so we'll prefer USB if connected and switch back to Bluetooth if USB is disconnected.
2022-09-26 14:20:34 -07:00
Sam Lantinga 17d7d03adf Added detection of the joystick type for third party PS4 and PS5 controllers 2022-09-26 08:12:35 -07:00
Sam Lantinga 8d2cb1555e Added an entry for the ZEROPLUS P4 Wired Gamepad 2022-09-23 16:56:24 -07:00
Sam Lantinga cb063db64f Moved XInputPS4 controllers into the PS4 controller section 2022-09-23 16:52:37 -07:00
Sam Lantinga 5b3b7e6e7c Separated PS4/PS5 effects support into individual capabilities 2022-09-23 16:46:36 -07:00
Sam Lantinga 33619aa2e9 Added support for the ZEROPLUS P4 Wired Gamepad to the HIDAPI driver 2022-09-23 16:38:15 -07:00
Sam Lantinga e888c99fa6 Fixed the entry for the Nacon PS4 Compact Controller 2022-09-23 16:26:41 -07:00
Sam Lantinga 4ea64fee9f Fixed manufacturer/product name deduplication for the Razer Raiju Tournament Edition controller 2022-09-23 15:29:00 -07:00
Sam Lantinga 56b91ea720 Fixed feature detection for the Razer Raiju Tournament Edition controller 2022-09-23 15:29:00 -07:00
Frank Praznik 4a06cc0f75 wayland: Apply modifier changes to the text of repeated keys
The text component of a repeated keystroke is initially set when a key is first pressed and the cached value remains static until the repeated key is released and another repeatable key is pressed. If the state of a modifier such as shift or capslock is changed while a key is being repeated, the text emitted will not have the modifier applied to it until the repeated key is released and pressed again.

Update the text to be repeated by a key if a modifier is changed while a key is actively being repeated.
2022-09-23 13:40:51 -04:00
Frank Praznik 467c82c771 wayland: Add mappings for the Escape and NumLock keys
The XKB keysym to SDL keycode mappings were missing for the Escape and NumLock keys, which prevented them from being remapped. Add them to the table so that the remapping of these keys will work.
2022-09-23 10:30:14 -07:00
Sam Lantinga 34f928abb7 Generate the correct name for ASTRO Gaming controllers
Manufacturer "ASTRO Gaming" and product "ASTRO C40" turns into "ASTRO C40"
2022-09-23 09:26:18 -07:00
Sam Lantinga 6ddef7c234 Generate the correct name for Qanba and Mad Catz controllers 2022-09-23 09:20:27 -07:00
Sam Lantinga c2ae2ccc32 Added feature support for the Razer Raiju to the HIDAPI driver 2022-09-23 09:11:12 -07:00
UnknownShadow200 5ea9886bcf haiku: Fix when screen color depth was 24 bits, SDL_GetWindowSurface would always fail with 'Unknown pixel format' error
Note that returning SDL_PIXELFORMAT_BGR24 instead of SDL_PIXELFORMAT_RGB24 seems necessary, otherwise when running with SDL_ACCELERATION=0, the red and blue channels of the window appeared swapped.
Note that when running with acceleration enabled, red and blue channel swapping does not happen regardless of whether SDL_PIXEL_FORMAT_RGB24 or SDL_PIXEL_FORMAT_BGR24 is returned.

For good measure, I also tested running with acceleration disabled in both 15 and 16 bit color depths, but red and blue channel swapping did not occur
2022-09-23 02:51:00 -07:00
Sam Lantinga 51fefd1c35 Added support for third party PS3 controllers to the HIDAPI driver 2022-09-23 02:39:35 -07:00
Sam Lantinga 5b4c10fc7b Return true from IsSupportedDevice if it's a device that we _might_ support
This forces an update of the device list so we have the correct state when we check to see whether a device is being handled by HIDAPI
2022-09-23 02:36:53 -07:00
Sam Lantinga 1d34a5249d Fixed shadowed variable warning 2022-09-23 00:38:23 -07:00
Sam Lantinga 010d3e6442 Fixed function prototype mismatch 2022-09-23 00:36:46 -07:00
Sam Lantinga b7940c29cc Allow HIDAPI controllers to override the default joystick type 2022-09-23 00:15:40 -07:00
Sam Lantinga 899a1e7cba Skip PS4/PS5 probe message if we already know it's a supported controller 2022-09-22 23:54:26 -07:00
Sam Lantinga fa2063fb44 Improved detection of third party PS4 and PS5 controllers 2022-09-22 23:42:25 -07:00
Sam Lantinga aa2e2f4843 Make sure HID devices can be opened before making them available to the application
This prevents a number of issues where devices are enumerated but not actually able to be opened, like https://github.com/libsdl-org/SDL/issues/5781.

We currently leave the devices open, allowing us to more easily do controller feature detection, protocol negotiation, detect dropped Bluetooth connections, etc. with the expectation that the application is likely to open the controllers shortly.
2022-09-22 18:27:38 -07:00
Sam Lantinga 2857e3c748 Added an entry for the Mad Catz FightStick TE 2+ PS3 2022-09-22 15:53:32 -07:00
Sam Lantinga 6812f1b5d7 Fixed the entry for the HORI Fighting Commander 4 in PS4 mode 2022-09-22 15:16:34 -07:00
Sam Lantinga 99e85cc27b Accidentally reverted 172865ff13 2022-09-22 10:10:20 -07:00
Sam Lantinga 6cbdc66650 Fixed use of uninitialized 'size' variable (thanks @ozkan!) 2022-09-22 09:05:06 -07:00
Sam Lantinga 0c4594ac72 Improved PS4 and PS5 third-party controller feature detection 2022-09-22 06:45:46 -07:00
Frank Praznik 399cb2f0de wayland: Only clear the key repeat flag when the repeated key is released
If multiple keys were simultaneously depressed and one was being repeated, the repeat flag was being cleared when any of the pressed keys were released, even if the released key wasn't the one being repeated.

This tracks the key currently being repeated and only clears the repeat flag when the particular key being repeated is released.
2022-09-21 14:26:13 -07:00
Sam Lantinga eb25f6c912 Fixed Xbox platform name, courtesy of @walbourn 2022-09-21 14:22:38 -07:00
zhailiangliang 00b67f5572 Fix potential memory leak in GLES_CreateTexture 2022-09-20 20:14:01 -07:00
past-due 301912a5b9 Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinates 2022-09-21 03:40:50 +03:00
Ivan Epifanov 08a331847b Vita: fix controls on PSTV with opened IME 2022-09-20 11:03:34 -07:00
Sam Lantinga dc2a682a82 Use the right kind of 0 2022-09-20 09:22:43 -07:00
Sam Lantinga 2461930601 Fixed build on RISC OS 2022-09-20 09:16:10 -07:00
Ozkan Sezer 887ae0c6eb fix build failure after commit 2a8d00634d if strtod isn't available. 2022-09-20 18:20:00 +03:00
Sam Lantinga 2a8d00634d Fixed scanning a negative number as an unsigned value
e.g. sscanf("-1", "%zu", &v)

Thanks to @sezero for the test case
2022-09-20 07:25:49 -07:00
Ozkan Sezer 3f5c46663e SDL_vsscanf: fix an uninitialized warning 2022-09-20 11:56:40 +03:00
Sam Lantinga 216e3f10bb Implemented size_t format specifiers for SDL_snprintf() and SDL_sscanf()
Fixes https://github.com/libsdl-org/SDL/issues/6264
2022-09-19 15:42:11 -07:00
Sam Lantinga 101306edcf Do case insensitive matching on test cases 2022-09-19 14:37:10 -07:00
Cameron Cawley 8598f05b47 Support loading 2bpp .bmp files 2022-09-17 16:50:45 -07:00
Cameron Cawley 1f7a7fd931 haiku: Combine HAIKU_ColorSpaceToBitsPerPixel and HAIKU_BPPToSDLPxFormat 2022-09-17 18:13:08 -04:00
Cameron Cawley 43fc6d593f Fix incorrect return value in X11_GetPixelFormatFromVisualInfo 2022-09-17 13:17:42 -07:00
Ivan Epifanov 7115ceb775 Vita: restore sceClibMemcmp 2022-09-17 10:12:46 -07:00
Sam Lantinga 2e9f5b5989 Added support for the HORI Fighting Commander OCTA (Xbox Series X and PS versions) 2022-09-16 15:41:35 -07:00
Ozkan Sezer 5fba31f6fb SDL_HasPrimarySelectionText: fix -Wunreachable-code-return warning. 2022-09-17 00:51:00 +03:00