Commit Graph

11266 Commits (02493579b5e4c4d9d482ba6df4c4058303bb3f3e)

Author SHA1 Message Date
Ozkan Sezer 4264c0b674 os2: fix error message for SDL_LoadObject() 2022-10-21 11:21:40 +03:00
Anonymous Maarten 96361fc476 cmake: create and install sdl2.pc for MSVC & WATCOM 2022-10-20 19:02:31 +02:00
Anonymous Maarten 11d53c84a7 cmake: use pkg-config's library dirs as hint for finding a shared library 2022-10-20 19:01:28 +02:00
Anonymous Maarten 94ac8ae08b cmake: else() does not need an argument 2022-10-20 13:29:35 +02:00
Sam Lantinga c6e8961979 Define _USE_MATH_DEFINES for Visual Studio (thanks @pionere!)
Fixes https://github.com/libsdl-org/SDL/issues/3790
2022-10-19 08:05:47 -07:00
Anonymous Maarten d542f43b2a cmake: add SDL_INSTALL_CMAKEDIR cache variable to override location of cmake config files 2022-10-19 16:41:25 +02:00
Brad Smith f28cf2b0d3 Also remove the OpenBSD comment about OSS 2022-10-19 06:40:19 -07:00
Ryan C. Gordon e7ab581d79
coreaudio: Dispose of AudioQueue before waiting on the thread.
Otherwise the thread might block for a long time (more than 10 seconds!).
It's not clear to me why this happens, or why its safe to do this with a
resource that's still in use, but we have, until recently, always
disposed of the AudioQueue first, so changing back is probably okay.

Also changed the disposal to allow in-flight buffers to reach hardware;
otherwise you lose the last little bit of audio that's already been queued
but not played, which you can hear clearly in the loopwave test program.

Fixes #6377.
2022-10-19 09:14:16 -04:00
Sam Lantinga 5b6d36fd9f Merge commit 'aefc6b5bb57cd3aadc6964e26f2caac1d1c5f624' into main 2022-10-18 09:21:53 -07:00
Sam Lantinga 764e7c4f4b Merge commit '965ba1e09712fc57968d87c1cf60c541529fbd20' into main 2022-10-18 09:21:51 -07:00
Sam Lantinga 8b6f726546 Merge commit 'dfbb93dd0c4bcdea2a3edc0e3cb0f5dae153d16e' into main 2022-10-18 09:21:48 -07:00
Sam Lantinga 86695af483 Merge commit 'e8a4c23ce560dad786922e8d51496da2687e1723' into main 2022-10-18 09:21:46 -07:00
Sam Lantinga 8f7577d70a Merge commit '790fa3156cfee847a7c0b34986de0cd7fdd7438f' into main 2022-10-18 09:21:44 -07:00
Sam Lantinga ac68c34f76 Merge commit '3ec4c9b3b9a29f17482ad2e130d6b14d79c5cb97' into main 2022-10-18 09:21:42 -07:00
Sam Lantinga 66226f6520 Merge commit '3d99d31026bb69e208ac82c30c67e62ca1333141' into main 2022-10-18 09:21:40 -07:00
Sam Lantinga aefc6b5bb5 Renamed variables, index is the singular of indices 2022-10-18 08:40:03 -07:00
GNQG 965ba1e097 fix SDL_SendEditingText when long composition text is enabled and strlen(text) == SDL_TEXTEDITINGEVENT_TEXT_SIZE 2022-10-18 08:26:27 -07:00
Sylvain dfbb93dd0c
SDL_Renderer / GLES2: add specific list of indice to render rect (see #6401) 2022-10-18 11:31:30 +02:00
Sylvain e8a4c23ce5
Revert commit 790fa3156c.
SDL_BLENDMODE_INVALID case is probably used for custom blendmode
2022-10-18 10:45:01 +02:00
Sylvain 790fa3156c
Fix warning: enumeration value 'SDL_BLENDMODE_INVALID' not explicitly handled in switch 2022-10-18 10:41:10 +02:00
Sylvain 3ec4c9b3b9
Merge remote-tracking branch 'refs/remotes/origin/main' 2022-10-18 10:37:22 +02:00
Sylvain 3d99d31026
Fixed bug #6401 - back-end can choose the order the triangles when rendering rects, attempt to fix small glitch rendering. 2022-10-18 10:34:56 +02:00
Wouter Wijsman 428b5ae546 PSP: Reorder extra imports 2022-10-18 10:34:51 +02:00
Sylvain 285cbf6fdd
Revert commit 485bb3565b.
"Fixed bug #6401 - change the order of triangles when using RenderCopy, RenderCopyEx and RenderFillRect"
because the glitch reappears on other backend
2022-10-18 10:04:06 +02:00
Sam Lantinga 0bc852ce53 Revert "Disable the RAWINPUT joystick driver by default"
Disabling RAWINPUT on Windows 10 causes these issues:
* All Xbox controllers are named "XInput Controller".
* Trigger rumble no longer works.
* "XInput Controllers" are now also listed as separate haptic devices
2022-10-17 17:43:06 -07:00
Deve 7e1088167a Fixed command modifier on macOS 2022-10-17 16:49:21 -07:00
Deve cdf312c83d Fixed mouse warp after resizing window on macOS. 2022-10-17 16:27:40 -07:00
David Jacewicz 7c7cd2a605 Fix issue #6037 (incorrect modifier flags on Wayland) 2022-10-17 13:27:39 -07:00
Wouter Wijsman 3903f4c88a PSP: Use vramalloc instead of conflicting valloc function
The libpspvram library was offering a function with conflicted with valloc. This has been renamed now, so SDL2 had to be updated for it.
2022-10-17 21:59:38 +02:00
Sam Lantinga 333935ff3f Make sure we completely unlock joysticks when opening HIDAPI devices
Also lock the joysticks when adding and removing Android joysticks
2022-10-17 11:10:53 -07:00
Sam Lantinga 47ba997f06 Disable the RAWINPUT joystick driver by default
It's only needed to support more than 4 Xbox controllers, and adds significant complexity to the joystick processing, and we regularly get bugs from people who aren't using an SDL window who need to turn on SDL_HINT_JOYSTICK_THREAD.
2022-10-17 07:39:52 -07:00
Sam Lantinga 5025f24033 Don't use RAWINPUT joystick driver on Windows XP
Fixes https://github.com/libsdl-org/SDL/issues/6400
2022-10-17 07:35:00 -07:00
Brad Smith f4e3af15a1 Simplify OSS test by removing OpenBSD specific location of the soundcard.h header
OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
2022-10-17 07:18:47 -07:00
Sylvain 485bb3565b
Fixed bug #6401 - change the order of triangles when using RenderCopy, RenderCopyEx and RenderFillRect 2022-10-17 13:30:30 +02:00
Sam Lantinga 70dfd6dd1a Added mapping for Xbox Series X controller
Fixes https://github.com/libsdl-org/SDL/issues/6296
2022-10-16 09:06:02 -07:00
Frank Praznik ed412c1385 wayland: Cleanup event source comments, headers, and error reporting
Replace instances of fprintf(stderr, ...) with SDL_SetError(), replace C++ comments with C style, use a uniform format for multi-line comments, and remove unused headers as poll and select aren't used in this file (the SDL function which calls them is used instead).
2022-10-16 08:40:50 -07:00
Daniel Bomar 22461383c6 SDL_audiocvt: Respct the SDL_HINT_AUDIO_RESAMPLING_MODE hint
This implements using libsamplerate for the SDL_AudioCVT API.
This library was already being used for audio streams when this hint is
set.
2022-10-15 14:31:00 -07:00
Sam Lantinga e8fdb861ef Removed redundant masking when loading the IMU calibration 2022-10-15 10:02:39 -07:00
happyharryh a6573f94ab Fix bugs in IMU calibration loading for Nintendo Controllers 2022-10-15 10:01:22 -07:00
Frank Praznik 6204768653 wayland: Don't block on libdecor_dispatch()
libdecor_dispatch() needs to be called, as libdecor plugins might do some required internal processing within, however care must be taken to avoid double-blocking in the case of a timeout, which can occur if libdecor_dispatch() and the SDL event processing both work on the main Wayland queue. Additionally, assumptions that libdecor will always dispatch the main queue or not process zero-length queues (can occur if a wait is interrupted by the application queueing an event) should not be made, as this behavior is outside the control of SDL and can change.

SDL handles polling for Wayland events and then calls libdecor to do its internal processing and dispatch. If libdecor operates on the main queue, it will dispatch the queued events and the additional wl_display_dispatch_pending() call will be a NOP. If a libdecor plugin uses its own, separate queue, then the wl_display_dispatch_pending() call will ensure that the main queue is always dispatched.
2022-10-15 09:33:37 -07:00
Frank Praznik e89389ba0e wayland: Use MAP_PRIVATE when mapping the keyboard keymap file descriptor
Per the Wayland spec, this must be mapped with MAP_PRIVATE in version 7 of the protocol and higher.
2022-10-15 09:30:06 -07:00
Sam Lantinga 5129a07707 Steam Controller support defaults off, as documented in SDL_hints.h 2022-10-14 14:35:52 -07:00
Sam Lantinga 6af17369ca Added mapping for Qanba Drone on Linux without HIDAPI 2022-10-14 10:36:24 -07:00
Sam Lantinga 93b7196763 Only update the battery level if we're on Bluetooth
Fixes battery level dropping to empty with the Qanba Drone Arcade Stick.

It looks like we might also be able to skip the check for all third party controllers, but I think this is the right thing to do for Sony controllers as well.
2022-10-14 10:32:03 -07:00
Sam Lantinga 120a957d07 Added support for the Qanba Drone Arcade Stick 2022-10-14 09:57:02 -07:00
Sam Lantinga 6bb0c2a5c2 Added documentation for some scancodes 2022-10-14 06:33:38 -07:00
Sam Lantinga 91ff88451b Disable "The key you just pressed is not recognized by SDL." message by default 2022-10-13 23:56:17 -07:00
Sam Lantinga 139192140c Fixed reported cases of "Keyboard layout unknown" messages
In all cases they were using SDL_SCANCODE_TABLE_XFREE86_2 with some keycodes remapped or fewer than expected keycodes. This adds a sanity check that catches all of them and gives them the right scancode table.
2022-10-13 23:23:55 -07:00
Sam Lantinga 2c1923859a Don't remove entries from an existing scancode keymap
If we can't find the X11 keysym, it's likely that either the keysym is NoSymbol, in which case we won't hit it anyway, or it's been mapped to a character, in which case the existing mapping is correct for the scancode and the character will be reflected in the keycode mapping.
2022-10-13 22:50:57 -07:00
Sam Lantinga 99f2a50394 X11 scancode mapping cleanup
* Consolidated scancode mapping tables into a single location for all backends
* Verified that the xfree86_scancode_table2 is largely identical to the Linux scancode table
* Updated the Linux scancode table with the latest kernel keycodes (still unmapped)
* Route X11 keysym -> scancode mapping through the linux scancode table (which a few hand-written exceptions), which will allow mappings to automatically get picked up as they are added in the Linux scancode table
* Disabled verbose reporting of missing keysym mappings, we have enough data for now
2022-10-13 22:41:47 -07:00