src


Log

Author Commit Date CI Message
Sam Lantinga e5e54169 2020-02-07T20:19:32 Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID. Specifically the Razer DeathAdder 2013 has this VID/PID
Sam Lantinga 833f76ab 2020-02-07T11:49:56 Fixed bug 4968 - NULL passed to memcpy in WriteProprietary in SDL_hidapi_switch.c meyraud705 In SDL_hidapi_switch.c line 443: Function BTrySetupUSB call WriteProprietary with pBuf=NULL and ucLen=0 line 376: WriteProprietary check its input (!pBuf && ucLen > 0) || ucLen > sizeof(packet.rgucProprietaryData): ucLen is 0 so it passes line 382: WriteProprietary call memcpy with pBuf=NULL
Sam Lantinga 8ba77b35 2020-02-07T11:44:57 Use the asynchronous HIDAPI rumble code for Nintendo Switch Pro controllers
Sam Lantinga 81256207 2020-02-07T11:02:34 Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms meyraud705 Dualshock4 on bluetooth need 78 bytes for the rumble data while SDL_HIDAPI_RumbleRequest can only hold 64 bytes. 'volatile' is not meant for thread synchronization. The list of rumble request could grow infinitely if user call SDL_JoystickRumble too much. The documentation says "Each call to this function cancels any previous rumble effect", so overwriting pending request seem like a good idea.
David Ludwig d88f3f52 2020-02-05T13:16:17 macOS: fix crash if and when joystick-init-on-add fails
Sam Lantinga a199cb89 2020-02-05T09:29:46 Updated the Android Xbox One Wireless Controller mapping for the latest Xbox controller firmware update
Sam Lantinga dc1d3c29 2020-02-04T18:36:23 Catch both PS3 and PS4 motion controls and don't treat them as a game controller
Sam Lantinga 1d1a35ef 2020-02-04T16:05:39 Fixed Visual Studio build
Sam Lantinga 1bd12026 2020-02-04T15:42:49 Added SDL_hidapi_rumble.c to the macOS, iOS and tvOS builds
Sam Lantinga 02108cf7 2020-02-04T15:27:25 Added missing files from previous commit
Sam Lantinga 1684606f 2020-02-04T15:26:56 Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers There is now a thread that handles all HIDAPI rumble requests and a lock that guarantees that we're not reading and writing the device at the same time.
Sam Lantinga 6efebf17 2020-02-04T12:48:53 Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests.
Sjoerd Simons 976eee77 2020-02-04T07:23:44 Correct joystick hat indexes on linux The index and indices were swapped; Which is fine as long as there are no gaps in the ABS_HAT* event availability but otherwise things do get confused. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Sam Lantinga 4b585e75 2020-02-03T08:06:52 Fixed bug 4833 - Use EGL for X11? Martin Fiedler To be precise, this is about *desktop OpenGL* on X11. For OpenGL ES, EGL is already used (as it's the only way to get an OpenGL ES context), as Sylvain noted above. To shine some light on why this is needed: In 99% of all cases, using GLX on X11 is fine, even though it's effectively deprecated in favor of EGL [1]. However, there's at least one use case that *requires* the OpenGL context being created with EGL instead of GLX, and that's DRM_PRIME interoperability: The function glEGLImageTargetTexture2DOES simply doesn't work with GLX. (Currently, Mesa actually crashes when trying that.) Some example code: https://gist.github.com/kajott/d1b29c613be30893c855621edd1f212e Runs on Intel and open-source AMD drivers just fine (others unconfirmed), but with #define USE_EGL 0 (i.e. forcing it to GLX), it crashes. The same happens when using SDL for window and context creation. The good news is that most of the pieces for EGL support on X11 are already in place: SDL_egl.c is pretty complete (and used for desktop OpenGL on Wayland, for example), and SDL_x11opengl.c has the aforementioned OpenGL-ES-on-EGL support. However, when it comes to desktop OpenGL, it's hardcoded to fall back to GLX. I'm not advocating to make EGL the default for desktop OpenGL on X11; don't fix what ain't broken. But something like an SDL_HINT_VIDEO_X11_FORCE_EGL would be very appreciated to make use cases like the above work with SDL. [1] source: Eric Anholt, major Linux graphics stack developer, 7 years ago already - see last paragraph of https://www.phoronix.com/scan.php?page=news_item&px=MTE3MTI
Sam Lantinga 67f44788 2020-02-03T00:57:12 Fixed bug 4917 - Wayland: handle discrete pointer axis events Luis Caceres The current handling of Wayland mouse pointer events only handles wl_pointer.axis events, which, according to the Wayland documentation, deal with mouse wheel scroll events on a continuous scale. While this is reasonable for some input sources (e.g. touchpad two-finger scrolling), it is not for mouse wheel clicks which generate wl_pointer.axis events with large deltas. This patch adds handling for wl_pointer.axis_discrete and wl_pointer.frame events and prefers to report SDL_MouseWheelEvent in discrete units if they are available. This means that for mouse wheel scrolling we count in clicks, but for touchpad two-finger scrolling we still use whatever units Wayland uses. This behaviour is closer to that of the X11 backend. Since these events are only available since version 5 of the wl_seat interface, this patch also checks for this and falls back to the previous behaviour if its not available. I also had to add definitions for some of the pointer and keyboard events specified in versions 2-5 but these are just stubs and do nothing.
Sam Lantinga b5849daf 2020-02-01T09:23:04 Fixed build warnings on Android
Sam Lantinga 212609b3 2020-01-31T14:09:23 Map the right pad on the Steam Controller to the right stick in the game controller API
Sam Lantinga 39a498c9 2020-01-31T13:09:20 Build the hidapi framework and weak link it on Mac OS X
Sam Lantinga 91121ee4 2020-01-31T10:45:04 Weak link the hidapi framework on iOS and tvOS
Sam Lantinga 1190343f 2020-01-30T16:02:56 Build hidapi as a framework on iOS, so it can be linked by the application as well.
David Ludwig 65fd6336 2020-01-30T18:03:34 FIX for SDL-4927: CFRetain+CFRelease a game controller's IOKit object This fixes a crash whereby SDL could crash on macOS/Darwin, if and when a USB game controller gets unplugged. SDL was not retaining a reference to the controller's OS/IOKit-provided 'device object', and was capable of trying to use it, after a device was hot-unplugged.
Sam Lantinga 62a3d6c0 2020-01-30T14:58:41 Fixed build
Sam Lantinga 37278066 2020-01-30T14:51:33 Export SDL functions for iOS application delegates
Ryan C. Gordon 66579dbd 2020-01-30T13:47:48 test: Common framework now accepts --usable-bounds command line argument.
Ryan C. Gordon 80e7e2eb 2020-01-30T13:47:19 test: change path in a comment from '\\' to '/' char. Nothing serious here.
Sam Lantinga 0641711e 2020-01-29T20:09:59 Added missing file from previous commit
Sam Lantinga 0897f235 2020-01-29T20:09:16 Fixed compiler warning
Sam Lantinga 355f0b54 2020-01-29T20:09:11 Added support for the Steam Controller on mobile devices
Sam Lantinga c9c89783 2020-01-29T20:09:08 Miscellaneous pending fixes
Sam Lantinga 43b377b0 2020-01-28T17:11:17 Fixed wired PS4 controller support on Android
Ryan C. Gordon 39563b7b 2020-01-28T13:51:24 x11: Use XSync when changing window position instead of XFlush. Attempt to fix regression in Bugzilla #4646.
Ryan C. Gordon c7e1b289 2020-01-27T17:15:12 cocoa: Fix command line apps' menu bar not working on macOS Catalina. Fixes Bugzilla #4937.
Ryan C. Gordon 059de38c 2020-01-27T15:44:48 darwin: Don't pass NULL device refs to IOHIDDeviceGetValue(). Possibly fixes Bugzilla #4961.
Ryan C. Gordon b4c2e29e 2020-01-27T10:58:30 video: Added a hint to override the display's usable bounds.
Sam Lantinga 7ea3f5b4 2020-01-26T12:48:35 Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble meyraud705 Switch hidapi and xinput also need to check for overflow, attached a patch for them.
Sam Lantinga 5e649983 2020-01-26T12:40:32 Don't enumerate devices we can't open
Sam Lantinga adb53d0b 2020-01-26T10:32:39 Fixed disabling the Xbox 360 wireless HIDAPI driver
Sam Lantinga c9f672fd 2020-01-23T22:24:24 Fixed compiler warnings
Sam Lantinga 2ae41b9c 2020-01-23T12:53:43 Fixed mapping for both versions of the Xbox One Elite Series 2 controller firmware connecting over Bluetooth
Sam Lantinga 48240ac8 2020-01-23T12:53:41 Added mapping for the Xbox One controller connected via the wireless dongle using xow
Sam Lantinga 6dc172d0 2020-01-23T12:53:39 Turn off rumble on drivers which don't respect the replay.length value
Sam Lantinga 30ff5fcf 2020-01-23T01:03:23 SDL_LEAN_AND_MEAN defaults off
Sam Lantinga b5e3d264 2020-01-23T01:00:52 Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds Protected more code with #ifdefs to reduce the size of minimal shared library builds
Sam Lantinga b1c6e7c2 2020-01-23T00:32:34 Fixed compile warning
Sam Lantinga 443bce74 2020-01-22T11:28:35 Added support for the paddles on the Xbox One Elite Series 1 controller
Sylvain Becker 6f89b059 2020-01-22T15:23:44 Documentation of the footprint #defines
Ryan C. Gordon f30ef6ed 2020-01-21T17:40:16 audio: Fixed a '//' style comment.
Sylvain Becker 55afc281 2020-01-21T22:06:09 Add #define SDL_HAVE_BLIT_N_RGB565 to compile out RGB565 LUT
Ryan C. Gordon dbe5c14b 2020-01-21T15:49:37 audio: Calculate a legitimate SDL_AudioSpec::silence in SDL_LoadWAV_RW().
Sylvain Becker 7df22cf2 2020-01-21T21:33:40 A few #defines to reduce SDL2 footprint. Only applied when library is statically linked
Sam Lantinga 25c88ea9 2020-01-20T13:53:40 The Xbox One 0x01 initialization packet is an ack packet
Sam Lantinga 9c3d1602 2020-01-19T11:43:36 Refactored code so SDL_GetJoystickGameControllerType() is called less during controller detection
Sam Lantinga ff068011 2020-01-18T11:21:42 Added missing file from previous commit
Sam Lantinga 43aa1fa9 2020-01-18T11:21:14 Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android
Sam Lantinga 27035425 2020-01-17T11:09:57 There are multiple bindings for XBox One controller model 1708, depending on firmware revision
Sam Lantinga bde1a371 2020-01-17T11:07:19 Added support for the NACON GC-400ES
Sam Lantinga 4e682461 2020-01-17T10:43:14 Reattach the kernel driver after closing USB controllers
Sylvain Becker 005e2dff 2020-01-17T12:41:54 Android: prevents rare crashes when app goes to background or ends. Make sure the thread is actually paused, and context backep-up, before SurfaceView is destroyed (eg surfaceDestroyed() actually returns). Add a timeout when surfaceDestroyed() is called, and check 'backup_done' variable. It prevents crashes like: #00 pc 000000000000c0d0 /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8) #01 pc 000000000000c7f4 /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::UpdateBufferList(ANativeWindowBuffer*)+284) #02 pc 000000000000c390 /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::DequeueBuffer()+240) #03 pc 000000000000bb10 /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::GetBuffer(EglSubResource*, EglMemoryDesc*)+64) #04 pc 000000000032732c /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::UpdateResource(EsxContext*)+116) #05 pc 0000000000326dd0 /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::GetResource(EsxContext*, EsxResource**, EsxResource**, int)+56) #06 pc 00000000002ae484 /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::AcquireBackBuffer(int)+364) #07 pc 0000000000249680 /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::Clear(unsigned int, unsigned int, unsigned int, EsxClearValues*)+1800) #08 pc 00000000002cb52c /vendor/lib64/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlClear(EsxDispatch*, unsigned int)+132)
Sylvain Becker d52ba78b 2020-01-17T12:04:18 Fixed bug 4246 - Android: orientation between portrait<->landscape doesn't work Improve handling of landscape/portrait orientation. Promote to SCREEN_ORIENTATION_SENSOR_* when needed. Android window can be somehow resizable. If SDL_WINDOW_RESIZABLE is set, window size change is allowed, for instance when orientation changes (provided the hint allows it).
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga 572f4a85 2020-01-16T15:54:20 Fixed bug 4929 - Software renderer produces bugs when optimizations are turned on with Visual C++ 2019 Konrad I took the liberty of rewriting this function a bit as it seemed to be unnecessary extended with ifs regarding flags (we can check everything in one pass which seem to be the thing which confuses Visual C++ 2019 as well). Also, I have made CPU features an int instead of uint because if we check it against flags which are all ints it might as well just be int (no signed/unsigned bitwise comparison).
Sam Lantinga c6817a2c 2020-01-16T15:32:41 Added support for the paddles on the Xbox One Elite Series 2 controller
Sam Lantinga 4e1cc124 2020-01-16T15:32:39 Improved Xbox One controller initialization
Sam Lantinga 981e0d36 2020-01-16T08:52:59 Fixed bug 4903 - Lack of color multiply with alpha (SDL_BLENDMODE_MOD + SDL_BLENDMODE_BLEND) blending mode for all renderers Konrad This kind of blending is rather quite useful and in my opinion should be available for all renderers. I do need it myself, but since I didn't want to use a custom blending mode which is supported only by certain renderers (e.g. not in software which is quite important for me) I did write implementation of SDL_BLENDMODE_MUL for all renderers altogether. SDL_BLENDMODE_MUL implements following equation: dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) dstA = (srcA * dstA) + (dstA * (1-srcA)) Background: https://i.imgur.com/UsYhydP.png Blended texture: https://i.imgur.com/0juXQcV.png Result for SDL_BLENDMODE_MOD: https://i.imgur.com/wgNSgUl.png Result for SDL_BLENDMODE_MUL: https://i.imgur.com/Veokzim.png I think I did cover all possibilities within included patch, but I didn't write any tests for SDL_BLENDMODE_MUL, so it would be lovely if someone could do it.
Sam Lantinga 669729a8 2020-01-15T22:18:31 Improved Xbox One controller initialization sequence This sequence works across Microsoft, PowerA, PDP, and HORI controllers. The newer Microsoft XBox firmware requires synchronizing the rumble sequence number, when SDL sees it after the initial connect The Razer Wildcat controller requires waiting for init responses before continuing the initialization sequence. The PDP Battlefield 1 controller takes over a second to be ready for initialization, and if initialization is attempted before then, it will fail.
Sam Lantinga 34486005 2020-01-15T22:18:29 Added support for the HORI Fighting Commander
Sam Lantinga 6705e27c 2020-01-13T22:05:58 Added D-PAD bindings for the Linux Steam Controller
Sam Lantinga cb800d1c 2020-01-13T22:05:56 Fixed compiler warning
Sam Lantinga 7775f7ce 2020-01-13T22:05:54 Fixed deadlock in HIDAPI joystick system
Sam Lantinga 3a796d6a 2020-01-13T15:35:54 Free the joystick player index when the joystick is removed
Sam Lantinga 3ce56f62 2020-01-13T08:12:10 Fixed error formatting
Sam Lantinga d2cda502 2020-01-12T17:22:24 Send the full Xbox One controller sequence for Microsoft controllers This switches Bluetooth controllers back into USB report mode for the latest Xbox One S and Xbox One Elite Series 2 firmware
Sam Lantinga 196f6998 2020-01-11T22:03:06 Fixed NEON detection on arm64 CPUs This probably breaks RISCOS, but we need a better fix from Cameron Cawley for this
Sam Lantinga c14a59d9 2020-01-11T13:38:50 Worked around an issue where the kernel would lose the force feedback effect
Sam Lantinga e3cedf96 2020-01-11T04:38:13 Add the destination format to the error when conversion isn't possible
Sam Lantinga d33b122f 2020-01-11T04:34:28 The Xbox One S Bluetooth controller with older firmware uses b16 as the guide button. The same controller with newer firmware uses b12 as the guide button. Map both buttons so both firmware revisions will work with the same mapping.
Sam Lantinga 5d28c315 2020-01-09T14:53:34 Only initialize Xbox One controllers once they're ready for initialization (or if they are silent until init) This fixes the Hyperkin Duke Xbox One controller showing the Xbox startup animation every time an SDL application launches
Sam Lantinga 47abe4e3 2020-01-09T14:53:30 Fixed crash when unplugging a HIDAPI controller
Sam Lantinga f34795d0 2020-01-08T18:55:53 Added support for the updated Hyperkin Duke Xbox One controller
Sam Lantinga f4375e86 2020-01-07T18:43:40 Added support for the 8BitDo M30 GamePad
Sam Lantinga a56aaea1 2020-01-07T16:47:56 Fixed handling the 8BitDo M30 in Nintendo Switch mode
Cameron Cawley 78ce18f5 2020-01-06T20:26:52 riscos: Add CPU feature detection
Sam Lantinga eb3d39bc 2020-01-06T12:18:51 Added support for the 8Bitdo FC30 Pro
Dmitry V. Levin 2b1edf41 2020-01-04T11:05:06 X11_InitKeyboard: do not call XAutoRepeatOn unnecessarily Use XGetKeyboardControl to initialize the current XKeyboardState, and skip XAutoRepeatOn invocation if global_auto_repeat is AutoRepeatModeOn. This fixes SDL2 when the X11 client is untrusted.
Dmitry V. Levin ed514cd0 2020-01-04T11:03:04 have_mitshm: use XShmQueryExtension to check for MIT-SHM extension Do not try to guess MIT_SHM extension availability from the string returned by XDisplayName, use the appropriate API instead. This fixes SDL2 inside hasher.
Sam Lantinga d9c4be06 2020-01-01T08:13:40 Added support for the Hyperkin Duke controller
Sam Lantinga 4c9628a0 2019-12-30T17:56:56 Fixed GameCube controller axis and trigger ranges and X and B button being swapped
Sam Lantinga 58a11d30 2019-12-30T13:21:47 Fixed bug 4920 - Wider support for seconds of battery life left on Linux platforms using sys interface Murad On my system, SDL_GetPowerInfo() returns -1 seconds of battery life left. I have quickly investigated that in my case SDL uses sys interface to get battery data. It tries to read "time_to_empty_now" file which is not always present. However, it is still possible to calculate remaining lifetime using "energy_now" and "power_now" files. This is what my simple patch (included as attachment) tries to accomplish. Best wishes.
Sam Lantinga 8b0660b2 2019-12-30T13:18:57 Fixed bug 4918 - SDL failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows LinGao We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows on latest default branch. And we found that it can be first reproduced on 0fff06175109 changeset. Could you please help have a look about this issue? Thanks in advance! Steps to Reproduce: 1.hg clone https://hg.libsdl.org/SDL D:\SDL\src 2.Open a VS 2017 x64 command prompt as admin and browse to D:\SDL 3.msbuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 VisualC\SDL.sln /t:Rebuild Actual result: Creating library D:\SDL\src\VisualC\x64\Release\SDL2.lib and object D:\SDL\src\VisualC\x64\Release\SDL2.exp SDL_joystick.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex [D:\SDL\src\VisualC\SDL\SDL.vcxproj] D:\SDL\src\VisualC\x64\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals [D:\SDL\src\VisualC\SDL\SDL.vcxproj] Done Building Project "D:\SDL\src\VisualC\SDL\SDL.vcxproj" (Rebuild target(s)) -- FAILED.
Sam Lantinga 98ce0e50 2019-12-30T11:09:03 Removed unnecessary setlocale() on Mac https://github.com/signal11/hidapi/commit/240bad3b669ad4874c8aa2d68e18e82232d63e35
Sam Lantinga a9482a1d 2019-12-30T09:44:32 Added support for the Nintendo GameCube adapter, tested on Steam Link hardware
Michael Forney cdbeae52 2019-12-29T23:10:39 wayland: support wl_data_device_manager version < 3
Ozkan Sezer 9340cfa9 2019-12-27T23:01:10 SDL_x11events.c (X11_DispatchEvent): remove FIXME and use SDL_strtokr().
Ozkan Sezer ef3ca2cc 2019-12-23T19:55:10 Fix build error in SDL_render_metal.m (bug #4916.) Patch provided by Konrad. Error was introduced by commit 522164980828 for bug #4914.
Sylvain Becker 6d639fce 2019-12-23T16:47:00 SDL_ScaleMode: fix compilation GLES renderer
Ryan C. Gordon 131e13a7 2019-12-22T20:48:43 direct3d11: Always set vertex buffers when updating them (thanks, Konrad!). Fixes Bugzilla #4913.
Sam Lantinga 982f8a83 2019-12-22T13:56:50 Fixed bug 4910 - Missing joystick-driver type check in haptic meyraud705 On Linux and MacOS, some haptic system functions access joystick->hw_data without checking the driver type.
Sam Lantinga 5e19e66c 2019-12-22T13:39:44 Fixed bug 4914 - Expose SDL_ScaleMode and add SDL_SetTextureScaleMode/SDL_GetTextureScaleMode Konrad This was something rather trivial to add, but asked at least several times before (I did google about it as well). It should be possible to dynamically change scaling mode of the texture. It is actually trivial task, but until now it was only possible with a hint before creating a texture. I needed it for my game as well, so I took the liberty of writing it myself. This patch adds following functions: SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode); SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode); That way you can change texture scaling on the fly.
Zack Middleton f0cee3ed 2019-12-22T13:15:11 Fix shutting down HIDAPI device with multiple joysticks Using Wii U GameCube USB adapter with multiple controllers attached and restarting SDL input in a game results in extra joysticks with NULL name. HIDAPI_CleanupDeviceDriver() shut down joysticks by iterating through device->num_joysticks but each HIDAPI_JoystickDisconnected() decreases device->num_joysticks and shifts joysticks array down. Resulting in only half of controllers being shutdown. It worked with only 1 controller attached though. Disconnect HIDAPI device joystick 0 until there are none left.
Sam Lantinga d000a592 2019-12-21T22:33:21 Fixed windows build