src


Log

Author Commit Date CI Message
Sam Lantinga 2db04947 2020-05-29T14:48:05 Fixed variable names to be consistent across functions
Sam Lantinga 345b4d7e 2020-05-29T13:37:21 Fixed bug 5161 - Autodetect controller mappings based on the Linux Gamepad Specification Jan Bujak I wrote a new driver for my gamepad on Linux. I'd like SDL to support it out-of-box, as currently it just treats it as a generic joystick instead of a gamepad. From what I can see the only way to do that is to either 1) pick one of the already supported controllers' PID, VID and button layouts and have my driver send that (effectively lying that it's something else), or 2) submit a preconfigured, hardcoded mapping to SDL. Both of those, in my opinion, are silly when we already have the Linux Gamepad Specification which standarizes this: https://www.kernel.org/doc/html/v4.15/input/gamepad.html Unfortunately SDL doesn't make use of it currently. So I've took it upon myself to add it; patch is in the attachments. Basically what the patch does is that if SDL finds no built-it controller mappings for a given joystick it then asks the joystick backend to autodetect it, and that uses the relevant evdev bits to figure out which button/axis is which. (See the specs for more details.) With this patch applied my own driver for my controller works out-of-box with SDL with no extra configuration and is correctly recognized as a gamepad; this is also going to be the case for any other driver which follows the Linux Gamepad Specification.
James Legg e2dbed9c 2020-05-29T13:05:37 SDL_blit: Fix undefined bitshift operations Arithmatic operations promote Uint8 to signed int. If the top bit of a Uint8 is set, and it is left shifted 24 places, then the result is not representable in a signed 32 bit int. This would be undefined behaviour on systems where int is 32 bits.
Ryan C. Gordon aa259ed5 2020-05-28T15:18:41 wayland: Changed output removal in handle_surface_leave() No longer needs an extra malloc, handles unexpected cases like the same output being listed twice.
Ryan C. Gordon ce7ae4ec 2020-05-28T14:57:10 wayland: Move buffer copy into mime_data_list_add() It makes it clearer who owns the memory, and more reasonable to free it on failure in the creating function. (and, of course, pacifies static analysis.)
Ryan C. Gordon 22da9d4d 2020-05-28T14:47:55 wayland: assert that mmap() didn't return NULL. In practice, it never _would_, but in theory it _might_, so this assertion tells the static analyzer not to worry about it.
Sam Lantinga 1a1f1704 2020-05-27T10:35:43 Don't include the iOS joystick driver if joysticks are disabled
Sam Lantinga 57149c24 2020-05-27T10:27:20 Fixed building with --disable-joystick on iOS
Sam Lantinga cf01ee16 2020-05-27T10:27:04 Fixed building with --disable-joystick on Linux
Sam Lantinga e9f567c7 2020-05-27T10:14:08 Fixed building on iOS with MFI controllers disabled
Sam Lantinga 97ca96bd 2020-05-27T10:13:01 Use nil instead of NULL for Objective-C objects
Sam Lantinga 03a7abf8 2020-05-27T09:57:26 Fixed building with --disable-joystick on macOS
Sam Lantinga af5eb56c 2020-05-27T09:28:03 Fixed uninitialized variable warning
Sam Lantinga 31916f11 2020-05-27T09:22:12 Fixed compiler warning building on FreeBSD
Sam Lantinga bcbaa4ec 2020-05-26T16:34:50 If there isn't a GetGlobalMouseState() implementation, fall back to the normal one.
Sam Lantinga 437577f9 2020-05-26T16:29:26 Fixed bug 5141 - KMSDRM: manage SDL_GetGlobalMouseState() Manuel Alfayate Corchete On the KMSDRM backend, there is no such thing as a desktop, yet some programs could (and DO) use SDL_GetGlobalMouseState(). So I think its good idea that, in KMSDRM, it returns the same mouse coordinates anyway as SDL_GetMouseState() would return. There is nothing else it could return, as far as I can understand, since there is no desktop anyway. This small patch does precisely that.
Sam Lantinga 1df0a1e4 2020-05-26T16:27:00 Fixed bug 5140 - KMSDRM: Dynamic vsync toggle does not work Manuel Alfayate Corchete The KMSDRM backend was doing things wrong because of some small (but important) misconceptions on how KMS/DRM works: to implement a largely broken non-vsync refresh mechanism, the SwapWindow() function was issuing new pageflips before previous ones had completed, thus causing EBUSY returns, buffer mismanagement, etc... resulting in general breakage on vsync disabling from apps, that would not allow vsync to work again without KMSDRM video re-initialization. To further clarify, on most DRM drivers async pageflips are NOT working nowadays, so all issued pageflips will complete on next VBLANK, NOT ASAP (calling drmModePageFlip() with the DRM_MODE_PAGE_FLIP_ASYNC flag will return error). The old code was assuming that can just issue a synchronous (=on VBLANK) pageflip and then pass a 0 timeout to the pull() function so we do not wait for the pageflip event, thinking that this will lead to correct non-vsynced screen updates from the program: That is plain wrong. Each pageflip has to be waite before issuing a new one, ALWAYS. And if we do not support ASYNC pageflips on the DRM driver level, then we are forced to wait for the next VBLANK. There is no way around it. I have also added many comments on the KMSDRM code. This is needed for future reference for me or others who may need to look at this code: KMS/DRM terminology regarding what SYNC and ASYNC mean in pageflip terms, and where to do certain things and why, is not trivial. It is not desirable or possible to invest time on researching the same concepts every time there is need to dive into this code. So please leave all these comments in the patch.
Sam Lantinga 15294e21 2020-05-26T13:54:47 Fixed iOS build
Sam Lantinga cc2fe84d 2020-05-26T13:19:48 Getting closer.
Sam Lantinga 0713c579 2020-05-26T13:19:44 More Linux fixes.
Sam Lantinga c7d1dab1 2020-05-26T13:19:41 Rename Linux-only variable.
Sam Lantinga b820a81f 2020-05-26T13:19:35 Include SDL_hints.h.
Sam Lantinga de866e66 2020-05-26T13:19:29 Include SDL_hint.h.
Sam Lantinga abd58418 2020-05-26T13:19:19 Make some changes to SDL_SetThreadPriority to try and have SDL transparently handle more of the work. 1. Comment that SDL_SetThreadPriority will make any necessary system changes when applying priority. 2. Add a hint to override SDL's default behavior for scheduler policy. 3. Modify the pthreads SDL_SetThreadPriority so that instead of just using the current thread scheduler policy it will change it to a policy that should work best for the requested priority. 4. Add hint checks in SDL_SetThreadPriority so that #3 can be overridden if desired. 5. Modify the Linux SDL_SetThreadPriority so that in the case that policy, either by SDL defaults or from the hint, is a realtime policy it uses the realtime rtkit API. 6. Prior to calling rtkit on Linux make the necessary thread state changes that rtkit requires. Currently this is done every time as it isn't expected that SDL_SetThreadPriority will be called repeatedly for a thread.
Sam Lantinga f16e6bfa 2020-05-25T14:10:51 Fixed creating a metal renderer without specifying a metal window
Sam Lantinga f176d7fd 2020-05-22T16:45:02 Added a note not to use XinputUap.dll for XInput support
Ryan C. Gordon 600a2fc7 2020-05-21T04:01:37 locale: Removed unused variable.
Ryan C. Gordon a299fdd7 2020-05-21T03:52:48 sensor: Fixed compiler warnings on mingw64.
Ryan C. Gordon ba11122e 2020-05-21T03:48:56 locale: Fixed compiler warning on Visual Studio.
Ryan C. Gordon b4e76b58 2020-05-20T17:32:23 sensor: Fix overaggressive search/replace. :)
Ryan C. Gordon 27c38eb2 2020-05-20T17:22:52 sensor: Correct fix for redefinition of various symbols.
Ryan C. Gordon 5fe34a40 2020-05-20T17:01:25 hidapi: Fix compiler warning.
Ryan C. Gordon c9d358bc 2020-05-20T16:59:35 sensor: Fix build on various Windows compilers with various predefinitions.
Ryan C. Gordon 68777406 2020-05-20T16:58:33 windows: Fix calls to CoCreateInstance() so last parameter is a LPVOID *.
Ryan C. Gordon 539125b8 2020-05-20T16:43:02 locale: Fixed compiler warning on WinRT.
Ryan C. Gordon d66b7366 2020-05-20T16:15:14 locale: Patched to compile on Windows Phone.
Ryan C. Gordon 3808b120 2020-05-19T03:14:46 locale: Make sure C++ implementations (Haiku!) use C linkage.
Ryan C. Gordon 863776f8 2020-05-19T01:19:52 haiku: Another attempt at fixing build.
Ryan C. Gordon e53d39cf 2020-05-19T00:09:59 haiku: Patched to compile.
Sylvain Becker db4246f6 2020-05-17T21:23:17 Only set colorkey, if converted surface has no alpha channel (2979)
Sylvain Becker f6197aec 2020-05-17T20:45:55 Fix issue with colorkey, palette and format conversion Set the colorkey information on the converted surface. Test-case in bug 3826/2979, conflicting with bug 4798
Sylvain Becker 39690a04 2020-05-15T21:33:47 Fix static analysis warning in SDL_render.c
Ryan C. Gordon daf360e0 2020-05-13T16:48:42 emscripten: Fix crash in SDL_SetWindowTitle(). This patch came from emscripten-ports, thanks! Fixes Bugzilla #5133.
Sam Lantinga b47f577a 2020-05-11T14:36:23 Fixed bug 5098 - macOS CreateWindowFrom doesn't work with high-dpi displays michaeljosephmaltese Display ends up taking only 1/4 of the screen area. It needs to call "setWantsBestResolutionOpenGLSurface:highdpi", like when creating a window the normal way.
Sam Lantinga eadc8693 2020-05-11T14:31:04 Fixed bug 5103 - Port fcitx support to both fcitx 4 & 5 wengxt Due to the new major fcitx version is coming close, the existing code need to be ported to use new Fcitx dbus interface. The new dbus interface is supported by both fcitx 4 and 5, and has a good side effect, which is that it will work with flatpak for free. Also the patch remove the dependency on fcitx header. Instead, it just hardcodes a few enum value in the code so need to handle the different header for fcitx4 or 5.
Sylvain Becker 2491f16f 2020-05-08T21:40:28 Android: send SDL_LOCALECHANGED when locale changes
Sylvain Becker 2a4ddeee 2020-05-08T11:15:38 Android: fix missing prototype warning
Sylvain Becker 0059ace0 2020-05-08T11:00:51 Android: factorize asset manager code (bug 2131 and 4297)
Sam Lantinga 1e5dd06f 2020-05-06T12:19:58 Added support for the HORI Real Arcade Pro on Mac OSX and Linux
Sam Lantinga cd2bdaef 2020-05-06T11:19:52 ControllerList: add PDP Faceoff Deluxe Audio Switch Controller and HORI Real Arcade Pro V Switch Edition
Sam Lantinga 0e5b48d2 2020-05-06T11:19:47 ControllerList: add NACON Revolution Unlimited (and it's dongle) and NACON Daija fight stick.
Ryan C. Gordon b3a34c94 2020-05-06T03:18:25 hid: Add Microsoft Precision Mouse to the joystick blacklist. Same deal as the Razer keyboards, it hangs the enumeration.
Ryan C. Gordon 85d97410 2020-05-06T03:13:44 hid: Cleanup Windows joystick blacklist code, to make additions easier.
Ryan C. Gordon b0a20a15 2020-05-05T12:48:55 stdlib: Fixed compiler warnings about int vs size_t.
Sam Lantinga 0eb6512b 2020-05-04T13:19:26 Fixed bug 5121 - Use SDL_calloc instead of calloc in Wayland_CreateWindow meyraud705 'SDL_Windows::driverdata' of a Wayland window is allocated by calloc in 'Wayland_CreateWindow' but freed by SDL_free in 'Wayland_DestroyWindow'.
Sam Lantinga 65ad4534 2020-05-04T13:17:43 Improvement for bug 3446 - The haptic API does not allow to select the direction axes meyraud705 I see how the documentation is confusing. I think that the choice of the axis is an implementation detail. The documentation should state the goal of this value, so I propose this wording: "Use this value to play an effect on the steering wheel axis. This provides better compatibility across platforms and devices as SDL will guess the correct axis." Value could even be renamed 'SDL_HAPTIC_STEERING_AXIS'. For Linux, sending an effect on the X axis with a Logitech wheel works. Others brands don't have driver for Linux as far as I know.
Sam Lantinga 11723411 2020-05-04T10:16:10 Added support for the Razer Kishi
Ryan C. Gordon fa23e3d0 2020-05-04T02:27:29 locale: Implemented SDL_GetPreferredLocales(). This was something I proposed a long time ago, Sylvain Becker did additional work on it, then back to me. Fixes Bugzilla #2131.
Ryan C. Gordon 8601996f 2020-05-03T22:13:48 hints: Allow specifying audio device metadata. This is only supported on PulseAudio. You can set a description when opening your audio device that will show up in pauvcontrol, which lets you set per-stream volume levels. Fixes Bugzilla #4801.
Sam Lantinga 8b60d39c 2020-05-02T14:43:17 Fixed bug 5112 - CMake won't compile in VS2019 dark_sylinc Trying to build SDL with VS2019 using CMake will encounter a linking error More specifically: 1>SDL_string.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_vsnprintf_REAL
Sam Lantinga b0b12e46 2020-04-27T13:31:10 Fixed running on older versions of iOS
Brendan Shanks 032fa681 2020-04-24T14:03:30 Add Logitech G29 to steering wheel list
Sam Lantinga 01fd8130 2020-04-23T11:13:02 Fixed compiler warning
Sam Lantinga c6b24b4b 2020-04-23T11:07:07 Added support for the following controllers: * 8BitDo N30 Pro 2 * 8BitDo SN30 Gamepad * 8BitDo SN30 Pro+ * 8BitDo Zero 2 * SZMY-POWER PC Gamepad * ThrustMaster eSwap PRO Controller * ZEROPLUS P4 Wired Gamepad In additional, all 8BitDo controllers use SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to have the correct mapping based on user preferences.
Sam Lantinga 4727f794 2020-04-23T10:13:17 Don't use the WGI driver if another driver is already handling the joystick
Sam Lantinga 6ca7f510 2020-04-23T09:35:32 Fixed crash trying to get battery status on some devices
Sam Lantinga 0f374b06 2020-04-22T15:42:32 Fixed build on older Visual Studio, enable new features on newer Visual Studio
Sam Lantinga 589d636b 2020-04-22T14:57:06 Fixed rare crash when creating an X11 window
Sam Lantinga d12ea89c 2020-04-22T10:50:50 Added support for the following controllers: * PDP Afterglow Switch Controller * Thrustmaster ESwap Pro PS4 controller * Giotek VX4 * Generic PS4 controller vid/pid that several knock offs use
Ryan C. Gordon 3625b83c 2020-04-21T01:32:48 hid: Add Razer Arctosa keyboard to hid enumeration blacklist. Hangs SDL, same as the Razer Lycosa. Fixes Bugzilla #5101.
Ryan C. Gordon 09ca66bf 2020-04-21T01:30:36 SDL_error: simplified error string management. This patch removes deferred error string formatting: now we do it during SDL_SetError(), so there's no limit on printf-style arguments used. Also removes stub for managing error string translations; we don't have the facilities to maintain that and the way we set arbitrary error strings doesn't really make this practical anyhow. Since the final error string is set right away and unique to the thread, we no longer need a static buffer for legacy SDL_GetError(), and we don't have to allocate 5x 128-byte argument fields per-thread. Also, since we now use SDL_vsnprintf instead of parsing the format string ourselves, there's a lot of code deleted and we have access to more robust formatting powers now. This does mean the final error strings can't be more than 128 bytes, down from the theoretical maximum of around 768, but I think this is probably okay. They might truncate but they will always be null-terminated! Fixes Bugzilla #5092.
Ryan C. Gordon 67760f0e 2020-04-20T18:58:18 joystick: Don't report duplicate recentering events for game controllers.
Ryan C. Gordon c5f2a1ce 2020-04-20T16:01:36 joystick: On disconnect, recenter all game controller inputs. The joystick layer can't necessarily give us perfect centering, but we know that the game controller level has logical absolute idle positions that have nothing to do with the physical device. So send game controller events to make it look like the device is completely untouched before sending the final removal event.
Sam Lantinga aba27928 2020-04-18T21:41:37 Added a Windows Gaming Input joystick driver This driver supports the Razer Atrox Arcade Stick Some of the quirks of this driver, inherent in Windows Gaming Input: * There will never appear to be controllers connected at startup. You must support hot-plugging in order to see these controllers. * You can't read the state of the guide button * You can't get controller events in the background
Sam Lantinga b90b5927 2020-04-17T21:30:58 Added support for the Razer Atrox Arcade Stick
Sam Lantinga dbcda0b2 2020-04-17T21:30:56 Added support for the Razer Wolverine Ultimate
Sam Lantinga 2b323855 2020-04-17T15:08:48 Don't send rumble packets too quickly to Nintendo Switch Pro controllers over Bluetooth
Sam Lantinga c02f54a0 2020-04-17T15:08:46 Fixed the default face button mapping for Nintendo Switch Pro controllers
Tudor Brindus 1a291ab1 2020-04-17T13:55:44 wayland: add support for SDL_SetWindowGrab
Ryan C. Gordon eaaa809e 2020-04-15T13:33:09 hidapi: Blacklist the Razer Lycosa keyboard from enumeration. It's not a joystick and it hangs device enumeration.
Ryan C. Gordon a7a4e16b 2020-04-15T13:31:54 haiku: Patched to compile.
Sam Lantinga a990a34a 2020-04-14T22:26:02 Cleanly switch between audio recording, playback, and both, on iOS
Sam Lantinga 14661d3f 2020-04-14T17:31:31 Added support for mousewheel on iOS
Sam Lantinga 50b1c195 2020-04-14T09:55:33 Fixed bug 5091 - Suspicious condition in HIDAPI_DriverXbox360_UpdateXInput meyraud705 On line 220 of SDL_hidapi_xbox360.c https://hg.libsdl.org/SDL/file/4608f0e6e8e3/src/joystick/hidapi/SDL_hidapi_xbox360.c#l220 if (!XINPUTGETSTATE(user_index, &xinput_state[user_index].state) == ERROR_SUCCESS) { logical not is only applied to the left hand side of this comparison. I think you mean: if (XINPUTGETSTATE(user_index, &xinput_state[user_index].state) != ERROR_SUCCESS) {
Sam Lantinga 2ae1c0f5 2020-04-14T09:52:27 Allow Bluetooth headphones for iOS playandrecord mode
Sam Lantinga f34d2c60 2020-04-14T07:35:35 Added zlib license for Steam Controller headers
Sam Lantinga 3e4856c9 2020-04-13T23:07:54 Fixed mouse button mapping on iOS
Sam Lantinga e1215e85 2020-04-13T22:50:46 Fixed mouse button mapping on iOS
Sam Lantinga dbf7f84f 2020-04-13T22:29:10 Implemented left/right mouse click detection on iOS
Sam Lantinga 171ba00a 2020-04-13T19:44:26 Hide the mouse cursor appropriately on iOS
Ryan C. Gordon 132f87c3 2020-04-13T22:06:12 opengl: Don't try to do Desktop OpenGL stuff if support isn't available.
Ryan C. Gordon a96d8a43 2020-04-13T22:05:36 render: Fixed compiler warning about implicit cast.
Sam Lantinga 6f3fa02e 2020-04-13T18:25:38 Make sure we're using the bounds of the view for our mouse region
Sam Lantinga cab1ee9c 2020-04-13T15:57:04 Don't build iOS mouse support on Apple TV
Sam Lantinga e5d36299 2020-04-13T15:46:12 Added support for new mouse APIs in iOS 13.4
Ryan C. Gordon e96b05c3 2020-04-13T18:21:28 egl: Attempt to make this compile on WinRT, etc.
Sam Lantinga 1d879787 2020-04-13T13:24:56 Fixed implicit linkage to ftol2() on Windows
Sam Lantinga c302c1ab 2020-04-13T13:24:19 Fixed build
Sam Lantinga bf87604e 2020-04-13T12:33:29 Fixed rare crash when unplugging Xbox controller on Windows
Conn O'Griofa c0a875fa 2020-04-13T14:48:38 SDL_EGL_ChooseConfig: don't fall through if no matching format exists On Raspberry Pi 3 via the VC4 driver in firmware KMS mode, none of the found configs match the desired format, causing the function to fall through without any config being selected. Fix by first iterating over the found configs, and if no match exists, don't exclude the non-matching configs. This should fix RPI3 and possibly other targets without breaking targets that have a matching native format (such as RPI4).