Log

Author Commit Date CI Message
Daid 287772f5 2020-04-09T15:01:45 emscripten: Let SDL_GetDisplayUsableBounds return the size of the window This does not account for scrollbars nor margins. But is much better then returning the full display size when not running fullscreen, but for example in an iframe.
Daid fb3df3a1 2020-04-09T15:01:41 emscripten: Fix the reported keys for the numpad. See https://github.com/emscripten-ports/SDL2/issues/94
Sylvain Beucler 44716b02 2020-04-09T15:01:37 emscripten: Send SDL_APP_TERMINATING before unload (#88)
Beuc 0380cbd7 2020-04-09T15:01:32 emscripten: Typo
Sam Lantinga d4f1b520 2020-04-08T19:16:31 Added support for press/release hardware keyboard events in iOS 13.4
Sam Lantinga e9c94ac0 2020-04-08T10:27:30 Fixed Windows accelerometer data units
Sam Lantinga 3d942ccc 2020-04-08T09:02:02 Removed debug code
Sam Lantinga 09f55263 2020-04-08T09:00:10 Fixed memory leak and removed debug code from Windows sensor implementation
Sam Lantinga 55515a8c 2020-04-08T08:42:15 SDL: ps4 controller trigger bits on other controllers just mean that there's some activity, not saturation - only force it on if the analog value is 0.
Sam Lantinga ba95fa61 2020-04-08T08:42:09 Revert "Fix incorrectly terminated MakeThreadHighPriority dbus message" The first terminator is for input parameters. The second terminator was for the output parameters. If an error occurs when calling MakeThreadHighPriority(), e.g. a bad thread id, then the reply from connection_send_with_reply_and_block() will be null.
Sam Lantinga 9cd06ac3 2020-04-08T08:41:55 Add perforce support to showrev.sh In order to generate meaningful output from SDL_GetRevision()
Sam Lantinga 3180ba81 2020-04-08T08:34:27 First pass at Windows sensor implementation
Ryan C. Gordon 6e6b5177 2020-04-07T23:34:41 cocoa: Patched to compile.
Ryan C. Gordon 8c165add 2020-04-07T23:17:27 joystick: Remove force_centering flag; we handle this on disconnect now.
Ryan C. Gordon fba081e4 2020-04-07T14:51:08 wasapi: Patched to compile on C89 systems, and use SDL_ceilf instead of ceilf.
Ryan C. Gordon 4c2be472 2020-04-07T14:37:24 wasapi: Improve WASAPI audio backend latency (thanks, Anthony!). Anthony Pesch's notes on his patch: "Currently, the WASAPI backend creates a stream in shared mode and sets the device's callback size to be half of the shared stream's total buffer size. This works, but doesn't coordinate will with the actual hardware. The hardware will raise an interrupt after every period which in turn will signal the object being waited on inside of WaitDevice. From my empirical testing, the callback size was often larger than the period size and not a multiple of it, which resulted in poor latency when trying to time an application based on the audio callback. The reason for this looked something like: * The device's callback would be called and and the audio buffer was filled. * WaitDevice would be called. * The hardware would raise an interrupt after one period. * WaitDevice would resume, see that a a full callback had not been played and then wait again. * The hardware would raise an interrupt after another period. * WaitDevice would resume, see that a full callback + some extra amount had been played and then it would again call our callback and this process would repeat. The effect of this is that the pacing between subsequent callbacks is poor - sometimes it's called very quickly, sometimes it's called very late. By matching the callback's size to the stream's period size, the pacing of calls to the user callback is improved substantially. I didn't write an actual test for this, but my use case for this was my Dreamcast emulator (https://redream.io) which uses the audio callback to help drive the emulation speed. Without this change and with the default shared stream buffer (which has a period of ~10ms) I would get frame times that were between ~3-30 milliseconds; after this change I get frame times of ~11-22 milliseconds. Note, this patch also has a change that removes passing a duration to the Initialize call. It seems that the default duration used (when 0 is passed) does typically match up with the duration returned by GetDevicePeriod, however the Initialize docs say: > To set the buffer to the minimum size required by the engine thread, the > client should call Initialize with the hnsBufferDuration parameter set to 0. > Following the Initialize call, the client can get the size of the resulting > buffer by calling IAudioClient::GetBufferSize. This change isn't strictly required, but I made it to hopefully rule out another source of unexpected latency." Fixes Bugzilla #4592.
Sam Lantinga 3cb62d52 2020-04-07T11:17:52 Fixed setting the controller name for the RAWINPUT driver
Sam Lantinga e62c25b6 2020-04-07T11:17:22 The 0x02ff product ID shows up for new firmware Xbox One controllers using the RAWINPUT driver
Ryan C. Gordon 8641f6e9 2020-04-07T14:03:13 emscripten: support KaiOS's Left Soft Key and Right Soft Key (thanks, pelya!). Fixes Bugzilla #5027.
Ryan C. Gordon 309d6137 2020-04-07T14:01:25 cocoa: OpenGL setView and update must be used on main thread (thanks, Tim!). If called from background threads, use Grand Central Dispatch to use the main thread instead. On the main thread, just call them directly. Fixes Bugzilla #4932.
Paul Cercueil 486f0b6c 2020-04-07T13:49:19 configure.ac: Fix stupid autotools errors Apparently, recent versions of autotools will issue an error if an empty description is supplied to AC_DEFINE(). Avoid these errors by just adding a space in the square brackets. Partially fixes Bugzilla #4908.
Ryan C. Gordon 02469877 2020-04-07T13:30:46 wayland: Support wayland compositors with wl_seat version < 5 (thanks, Nia!). Fixes Bugzilla #5074.
Sam Lantinga 88cecee4 2020-04-07T10:14:12 Fixed build warning
Sam Lantinga 50cb8e0f 2020-04-07T10:13:08 Fixed deadlock in new raw input joystick code The appropriate locking is done elsewhere, this prevents inverted lock acquisition
Sam Lantinga b6afbe63 2020-04-07T09:38:57 Added SDL_log.h to SDL_internal.h so logging is available everywhere
Sam Lantinga 488b94cb 2020-04-07T09:18:19 Don't interpret raw input messages with no mouse position This happens occasionally on touch devices when raw input is enabled
Sam Lantinga 0721931f 2020-04-06T19:21:56 Avoid sending regular mouse messages for touch input
Sam Lantinga dad73b1f 2020-04-05T10:47:58 Fixed bug 5073 - SDL does not handle URL Schemes in MacOS Jason In iOS, URL Events trigger the DropFile event. I would also expect the same event to be fired on the macOS platform but this is not implemented at all in the AppDelegate.
Sam Lantinga 9525f972 2020-04-05T10:44:51 Fixed bug 5076 - SDL_netbsdaudio: Add support for 32-bit LPCM Nia Alarie The kernel supports this, make SDL expose it so it can be used.
Sam Lantinga e05d92a1 2020-04-05T09:01:33 Fixed bug 5075 - Don't assume a GL library version number on NetBSD. Nia Alarie If you install X as part of NetBSD, the GL library is libGL.so.3, but if you install the GL library later as a package, it's libGL.so.1.
Sam Lantinga d4b561f4 2020-04-05T08:58:47 Fixed bug 5015 - SDL_RenderReadPixels on DirectX 11.1 backend seems to be broken Konrad It appears that I cannot use SDL_RenderReadPixels on a bound framebuffer (SDL_Texture set as render target) as it simply results in gibberish data. However, drawing that framebuffer into the default target (window surface) does render it correctly. Other backends (OpenGL, software, Direct3D) do work fine. It looks to me like D3D11_RenderReadPixels just gets the general backbuffer and not the current render target and its backbuffer. Here is the patch which actually fetches the current render target and its underlying ID3D11Resource which is ID3D11Texture2D.
Sam Lantinga 89fe32dd 2020-04-05T08:46:59 Fixed bug 5072 - Test resources missing when building with SDL_TEST and CMake DominikD There are several tests that need resources in the output directory to work: * `testiconv` depends on `utf8.txt` * `testoverlay2` and `teststreaming` depend on `moose.dat` This patch adds these two files to the `RESOURCE_FILES` variable. One could also copy `shapes\*.bmp` over to the output directory for `testshape` to use but this patch doesn't do that for three reasons: * executable takes path as an argument and doesn't need these files side by side * these are ~45MB and copying them over would cause build directory to swell * there are already files in the output directory that can be used with this test (`sample.bmp` and `button.bmp`)
Sam Lantinga f3e60967 2020-04-02T12:27:29 Fixed setting the "playandrecord" audio hint on Apple TV The Apple TV doesn't have record capability by default, so activating the audio session with AVAudioSessionCategoryPlayAndRecord fails.
Sam Lantinga 378a5cfb 2020-04-01T16:39:05 Updated thread priorities for Apple operating systems
Ryan C. Gordon 377f2d35 2020-04-01T13:43:53 configure: Remove wayland-protocols check from configure and CMake scripts. We ship these with SDL now, don't need the system versions installed.
Sam Lantinga 3154d924 2020-03-30T14:26:21 SDL: plumb previously unused digital trigger bits for PS4 controllers. Victrix fight stick only sets these bits and doesn't send the analog values CR: SamL
Sam Lantinga f4a56d7e 2020-03-30T14:26:15 Enable thread-safety features in libdbus There are multiple SDL APIs that internally sink into dbus calls, e.g. battery status, thread priority. If those calls happen in different threads simultaneously it can result in dbus crashes. To abide by dbus's multithreading guidelines we must call dbus_threads_init_default() to enable dbus's internal locking mechanisms: https://dbus.freedesktop.org/doc/api/html/group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc Additionally, access to a DBusMessage must be synchronized between threads. SDL was already abiding that guideline as the DBusMessage structs aren't shared. The following email from the dbus mailing list hints that arbitrating access to the DBusConnection on the SDL may also be required: https://lists.freedesktop.org/archives/dbus/2017-September/017306.html
Sam Lantinga 2e667a8b 2020-03-30T14:26:10 Fix incorrectly terminated MakeThreadHighPriority dbus message Currently the message is double terminated, which results in SDL_DBus_CallMethodInternal() incorrectly assuming that the other party is always returning true. I'm not super familiar with dbus, so I'm not sure if this could also be the cause of this bug: https://github.com/ValveSoftware/steam-for-linux/issues/6901
Ryan C. Gordon 55b4f18e 2020-03-29T01:54:00 coreaudio: The default SDL audio device now tracks the system output default. So if you go into System Preferences on a MacBook and toggle between a pair of connected bluetooth headphones and built-in internal speakers, SDL will switch the device it is playing sound through, to match this setting, on the fly. Likewise if the default output device is a USB thing and is unplugged; as the default device changes at the system level, SDL will pick this up and carry on with the new default. This is different from our unplug detection for specific devices, as in those cases we want to send the app a disconnect notification, instead of migrating transparently as we now do for default devices. Note that this should also work for capture devices; if the device changes, SDL will start recording from the new default. Fixes Bugzilla #4851.
David Ludwig 6e7465bd 2020-03-28T15:43:55 Fixed Bug 4883, redux - connect SDL_GetDisplayDPI to UIKit_GetDisplayDPI SDL_GetDisplayDPI was failing on iOS, as UIKit_GetDisplayDPI was not getting assigned to SDL's internal field in SDL_VideoDevice: GetDisplayDPI.
Sam Lantinga abdc5cbf 2020-03-26T19:30:17 Allow background music to play in the "play and record" case on iOS
Ryan C. Gordon 46bb47cf 2020-03-26T22:14:59 thread: Put all important SDL_CreateThread internal data into SDL_Thread. This avoids the need to malloc something extra, use a semaphore, etc, and fixes Emscripten with pthreads support, which might not spin up a web worker until after SDL_CreateThread returns and thus can't wait on a semaphore at this point in any case. Fixes Bugzilla #5064.
Ryan C. Gordon 369e5f33 2020-03-26T20:28:04 dbus: System bus is optional, we only need a session bus (thanks, tamo!). Fixes Bugzilla #4795.
Ryan C. Gordon 07f231ee 2020-03-26T18:47:04 joystick: Make sure recentering events happen before disconnect events. Fixes Bugzilla #5063.
Ryan C. Gordon f2ff953e 2020-03-26T13:42:56 cocoa: Just update the OpenGL context directly if on the main thread.
Michael Maltese 361417c0 2020-03-25T16:40:43 cocoa: allow calling CreateWindowFrom on an NSView This lets applications embed SDL with other widgets surrounding it. Already possible on Windows and X11. Fixes Bugzilla #5060.
Fabrice Fontaine 9354aea1 2020-03-25T09:38:45 src/video/kmsdrm/SDL_kmsdrmvideo.c: fix build Build is broken without EGL since version 2.0.12 and https://hg.libsdl.org/SDL/rev/72cc4740dec2: /home/giuliobenetti/autobuild/run/instance-1/output-1/build/sdl2-2.0.12/src/video/kmsdrm/SDL_kmsdrmvideo.c: In function 'KMSDRM_CreateSurfaces': /home/giuliobenetti/autobuild/run/instance-1/output-1/build/sdl2-2.0.12/src/video/kmsdrm/SDL_kmsdrmvideo.c:394:5: error: unknown type name 'EGLContext' EGLContext egl_context; ^ Fixes: - http://autobuild.buildroot.org/results/fafd20a01591032662f9ca025fcea3478239cf3c Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Jay Petacat c760c02c 2020-03-25T01:34:15 Fix some format specifier warnings The warnings were produced by GCC 9.2.x for x86_64-linux-gnu or i386-pc-msdosdjgpp targets. Most of the fixes involve changing the type of a variable rather than the format specifier. For many of the affected test conuter variables, a basic int seems sufficient. Some format specifier warnings still remain for cases where changing type or casting seemed inappropriate. Those warnings will probably require some new format specifier macros (e.g. SDL_PRIu32).
Fabrice Fontaine a4b0204b 2020-03-24T10:05:51 src/video/directfb/SDL_DirectFB_render.c: fix build Build with directfb is broken due to a spurious '}' and a missing 'E' since version 2.0.12 and https://hg.libsdl.org/SDL/rev/4c2dcf490cba: /home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c: In function 'SetBlendMode': /home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:202:9: error: case label not within a switch statement 202 | case SDL_BLENDMODE_MUL: | ^~~~ /home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:205:67: error: 'DSBF_DSTCOLOR' undeclared (first use in this function); did you mean 'DSBF_DESTCOLOR'? 205 | SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR)); | ^~~~~~~~~~~~~ Fixes: - http://autobuild.buildroot.org/results/83ccefee68c2800c0544e6f40fa8bc8ee6b67b77 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Sam Lantinga 885b3f69 2020-03-23T14:10:25 Don't check the HIDAPI driver for the virtual device created by xow
Sam Lantinga 2c02b741 2020-03-23T12:10:05 Fixed bug 5052 - Interval between SDL_SENSORUPDATE events for gyroscopes is too high Andrei Kortunov Hello. I try to implement an application for Android, which uses a new sensors API from 2.0.9 to control a camera rotation via built-in gyroscope, using the code from the test/testsensor.c as an example. Gyroscope input itself works well, but an interval between SDL_SENSORUPDATE events is about 200ms (the SENSOR_DELAY_NORMAL, I believe), when I need the interval about 20-40ms (the SENSOR_DELAY_GAME or SENSOR_DELAY_FASTEST).
David Ludwig 68c7e80d 2020-03-23T14:54:31 iOS: fixed bug whereby some SDL testing apps weren't launching Test apps in Xcode-iOS/Test/TestiPhoneOS.xcodeproj weren't launching in the most-recent release of Xcode and the iOS Simulator (version 11.3.1). This was caused by their shared Info.plist file not defining a CFBundleShortVersionString (as reported by Xcode, when launching a test app from within Xcode).
Sam Lantinga 1fd548b6 2020-03-23T11:42:44 Fixed building back to Mac OSX using the 10.7 SDK
Jay Petacat e0a27056 2020-03-22T20:09:14 Do not overwrite window surface created by driver If a driver's implementation of CreateWindowFramebuffer sets the window surface, use that rather than overwriting it. A driver may set the window surface if data cannot be passed via the CreateWindowFramebuffer output parameters (e.g. surface palette colors).
Ryan C. Gordon 19a5f4ab 2020-03-22T14:32:47 opengl: Don't enable/disable texturing except when actually rendering. Otherwise our cached state goes out of sync when updating a texture. Since these state changes aren't necessary, they were removed instead of updating the cached state. Fixes Bugzilla #4998.
Sam Lantinga cb8c91d9 2020-03-22T11:01:14 Fixed bug 5051 - Switch Pro Controller hidapi driver does not report battery levels when connected via Bluetooth bluenaxela+sdl I've noticed that the Switch Pro Controller hidapi driver does not report battery levels when connected via Bluetooth, despite having code for setting joystick->epowerlevel. This is caused by the driver always using k_eSwitchInputReportIDs_SimpleControllerState via Bluetooth. Using that mode means that the state reports you get back from the controller do not include battery state. Not using the full controller state over Bluetooth effectively makes this driver's support for setting joystick->epowerlevel entirely pointless, only ever reporting SDL_JOYSTICK_POWER_WIRED. Is there a reason this was set to only use SimpleControllerState via Bluetooth? I've attached a patch I'm using to allow getting battery level for the Switch Pro Controller. A couple notes about this patch: 1) It changes LoadStickCalibration to accept the input_mode that is selected, because that's really what should determine what is used for stick extents, since stick extents differ between the modes. 2) In my patch I only use FullControllerState when the vid/pid matches the official Switch Pro Controller, as a cautionary measure in case some third-party controllers have problems with FullControllerState mode via Bluetooth (I noticed a HORI Wireless Switch Pad I had seemed to not read controller calibration correctly for stick extents. Maybe it's calibration data was uninitialized on account of having never been used with a Switch? I'm unsure, though if that guess is right maybe SDL2 should be detecting an uninitiated calibration state and using some sensible defaults)
Sam Lantinga f55cbdfd 2020-03-20T21:05:07 Allow Valve devices in driver check, we know they're well behaved controllers
Sam Lantinga 6e646b61 2020-03-20T20:53:26 Removed blacklist entries for devices that aren't game controllers, allow Steam Controllers
Sam Lantinga 106ffd57 2020-03-20T20:45:30 Fixed bug 5049 - HORI Wireless Switch Pad does not connect properly via Bluetooth bluenaxela+sdl The HORI Wireless Switch Pad does not properly connect via bluetooth. I did some debugging and found that the code that tries to control the Home LED causes this controller to disconnect.
Sam Lantinga 269f8215 2020-03-20T20:40:14 Fixed build warning when using mingw-64 - the SDL code doesn't have any undefined symbols
Sam Lantinga 891bd829 2020-03-20T20:33:26 Fixed warning building version.rc using mingw-64
Sam Lantinga 1a6f6054 2020-03-20T19:51:54 Regenerated configure with configure.ac changes
Jimb Esser 417713a7 2020-03-20T19:49:19 Probable fix for compile errors on Mac OS and (non-VS) Win32
Sam Lantinga dc36f133 2020-03-20T19:49:15 Backed out changeset c29d04c3fa49
Sam Lantinga 74ba3cb4 2020-03-20T19:48:26 Backed out changeset c5bb2de42684
Sam Lantinga 2db65a7f 2020-03-20T19:47:46 Fixed compile warnings
Sam Lantinga c63bb512 2020-03-20T19:42:59 Only build raw input support on Windows
Sam Lantinga b6eb09ff 2020-03-20T15:55:02 Updated documentation so people know to set the SDL_HINT_NO_SIGNAL_HANDLERS hint before SDL_Init()
Cameron Gutman 5ed71f3b 2020-03-20T13:44:50 Only enumerate HID devices on Windows that have gamepad HID usages There are a number of poorly behaved HID devices that time out on attempts to read various strings. Rather than end up on an endless treadmill of blacklisting broken devices, reduce our risk by only querying devices that are gamepads. SDL_hidapijoystick.c already checks these same usages, so we shouldn't exclude any working HID devices (caveat below). This also makes HidP_GetPreparsedData() and HidP_GetCaps() failure skip the device entirely, but that seems desired. If a device can't even return basic top-level collection data properly, we want nothing to do with that broken device. If we do find devices that work with HIDAPI joystick and fail these calls, we can add an exception via VID+PID matching.
Sam Lantinga f7c9502d 2020-03-20T12:13:26 Fixed bug 5044 - CMake messes up hidapi path when project directory contains spaces Eric Jing When the project directory path contains spaces, CMake butchers the include path for the hidapi files. I traced the problem to the cmake/sdlchecks.cmake file at line 1091, which sets flags for the build process. I surrounded the problem flag with double quotes, shown below, and CMake works with spaces in the project directory path.
Ryan C. Gordon 90f9e8f8 2020-03-20T15:13:09 egl: Don't use SDL_LoadFunction to get GL entry points on Emscripten. This results in a dlsym() call, which causes Emscripten to panic if the game wasn't explicitly built dlopen support. eglGetProcAddress works just fine on this platform, so just let that codepath handle it.
Emir Marincic 5b3b55a1 2020-03-20T11:52:18 [NSOpenGLContext update[ is prohibited outside the main thread
David Ludwig 7e5340c5 2020-03-17T17:34:24 Fix for Bug 5034 - Replugging in a controller crashes on macOS in SDL 2.0.12 This is a multi-part fix, and is the 2nd attempt at a fix for Bug 5034. Here are the problems being addressed: 1. On macOS 10.14.x and earlier, trying to call IOHIDDeviceUnscheduleFromRunLoop without a prior, paired call to IOHIDDeviceScheduleWithRunLoop, appears to lead to a crash. A per-device flag has been added to make sure that these calls are paired. 2. DARWIN_JoystickDetect was free'ing its SDL_joystick's hwdata field (via FreeDevice) without setting it to NULL, and DARWIN_JoystickRumble wasn't checking for a NULL hwdata. FreeDevice will now set hwdata to NULL and DARWIN_JoystickRumble will check for a NULL hwdata.
Sam Lantinga 4c22a21e 2020-03-17T14:18:05 Fixed bug 3446 - The haptic API does not allow to select the direction axes meyraud705 Added Linux implementation, otherwise you get "Unsupported direction type" error. Added documentation to explain why one would use SDL_HAPTIC_FIRST_AXIS.
Sylvain Becker e6189f40 2020-03-17T15:47:30 Fix warnining implicit declaration of SDL_DetectPalette (Thanks meyraud705)
Sylvain Becker 838bbf1f 2020-03-17T09:35:42 Fixed bug 5037 - Regression 2.0.12 Alpha value of 0 on palette may become opaque (see also bug 3827)
Flamefire ccc8c5d2 2020-03-17T08:46:34 Fix shared library suffix on OSX
David Ludwig 36d58451 2020-03-17T02:31:47 Backout prior fix for Bug 5034, which needs more research This backs-out the change, https://hg.libsdl.org/SDL/rev/14c961903135
Sam Lantinga 55a2a12d 2020-03-16T22:34:33 Fixed compile warning
Sam Lantinga 9b879a08 2020-03-16T19:15:28 Fixed compiler warning
Jimb Esser c2c5d0b3 2020-03-16T16:52:49 Fix compile error
David Ludwig 197b14de 2020-03-16T19:24:25 Fixed Bug 5034 - Replugging in a controller crashes on macOS in SDL 2.0.12 The Darwin/macOS joystick driver was freeing its joystick's hwdata field without zeroing it out in any live instance of SDL_Joystick.
Jimb Esser 47da53b9 2020-03-16T14:49:20 Fix compiler warnings
David Ludwig 8cd08646 2020-03-16T17:19:18 virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038)
Sam Lantinga 73799917 2020-03-16T13:28:38 Fixed bug 3446 - The haptic API does not allow to select the direction axes Mathieu Laurendeau Consider a device supporting effects on multiple axes. There's currently no way to play effects against a single-axis direction. A device supporting effects against X and Y may not allow to play effects with a two-axis direction coordinate, even if one of the coordinates is null. My current (ugly) work around for this is to add a direction type SDL_HAPTIC_X_FORCE to play effects against a X-axis only direction (patch attached). This issue impacted two GIMX users using the following wheels: - Leo Bodnar SimSteering force feedback wheel - Accuforce direct drive wheel Playing constant/spring/damper effects against a X-axis direction worked well for the first wheel, but not for the second one. A better strategy seems to play the effects against the first axis reported by the DirectInput enumeration. This strategy also works with Logitech wheels (at least the DFGT). It's been more than a year that I have the latest patch (playing effects against the first axis only) in the GIMX software. It's being used by thousands of people, mostly for adapting their FFB wheel to the PS4. I had no report that proves this strategy to be wrong.
Sam Lantinga 543994b1 2020-03-16T12:25:02 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows Jimb Esser Add new RawInput controller API, and improved correlation with XInput/WGI Reorder joystick init so drivers can ask the others if they handle a device reliably Do not poll disconnected XInput devices (major perf issue) Fix various cases where incorrect correlation could happen Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation Correlate by axis motion as well as button presses Fix failing to zero other trigger Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init() Add missing device to device names Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices Updated to SDL 2.0.13 code with the following notes: New HID driver: xbox360w - no idea what that is, hopefully urelated SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data. SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem. Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason. Something changed in how devices get names, so getting generic names. Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
Sam Lantinga 4dea340c 2020-03-16T12:23:38 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows Jimb Esser Add new RawInput controller API, and improved correlation with XInput/WGI Reorder joystick init so drivers can ask the others if they handle a device reliably Do not poll disconnected XInput devices (major perf issue) Fix various cases where incorrect correlation could happen Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation Correlate by axis motion as well as button presses Fix failing to zero other trigger Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init() Add missing device to device names Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices Updated to SDL 2.0.13 code with the following notes: New HID driver: xbox360w - no idea what that is, hopefully urelated SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data. SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem. Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason. Something changed in how devices get names, so getting generic names. Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
David Ludwig cc37ee8a 2020-03-16T00:21:22 virtual joysticks: add autotools-build support (Bug 5028) Autotools support for virtual-joysticks turns it OFF by default. To turn it on, pass the following into configure: --enable-joystick-virtual
David Ludwig 40625c4e 2020-03-15T16:01:19 virtual joysticks: MSVC support part 2/2, add file refs to MSVC projects (bug 5028)
David Ludwig b2296506 2020-03-15T15:05:36 virtual joysticks: MSVC support part 1/2, make driver's .c file be uniquely named
David Ludwig 513730c4 2020-03-15T14:40:51 iOS: fixed build error when building test apps via Xcode CoreBluetooth.framework needed to get linked into test apps, all of which are currently using statically-linked SDL.
David Ludwig 9b1ea290 2020-03-15T14:21:05 virtual joysticks: added source files to Xcode projects (Bug 5028)
David Ludwig d6476155 2020-03-15T13:35:03 virtual joysticks: improved docs for SDL_JoystickSetVirtual* functions
David Ludwig cc908756 2020-03-15T13:25:49 virtual joysticks: removed ball support (Bug 5028)
Sam Lantinga 151c8fbf 2020-03-14T17:45:00 Fixed build error Malte Kie?ling I get a build error in SDL_sysjoystick.c:74 for the merged patch, but its nothing to sweat about, just -Werror=declaration-after-statement doing its usual stuff.
Sam Lantinga 1ff483d1 2020-03-13T21:28:09 Added SDL_GetErrorMsg() to get the error message in a thread-safe way
Sam Lantinga 19c34844 2020-03-13T19:19:29 Fixed slow enumeration when Apple Cinema HD display 30" is plugged in
Sam Lantinga 2be75c6a 2020-03-13T19:08:45 Fixed bug 5028 - Virtual Joysticks (new joystick backend) David Ludwig I have created a new driver for SDL's Joystick and Game-Controller subsystem: a Virtual driver. This driver allows one to create a software-based joystick, which to SDL applications will look and react like a real joystick, but whose state can be set programmatically. A primary use case for this is to help enable developers to add touch-screen joysticks to their apps. The driver comes with a set of new, public APIs, with functions to attach and detach joysticks, set virtual-joystick state, and to determine if a joystick is a virtual-one. Use of virtual joysticks goes as such: 1. Attach one or more virtual joysticks by calling SDL_JoystickAttachVirtual. If successful, this returns the virtual-device's joystick-index. 2. Open the virtual joysticks (using indicies returned by SDL_JoystickAttachVirtual). 3. Call any of the SDL_JoystickSetVirtual* functions when joystick-state changes. Please note that virtual-joystick state will only get applied on the next call to SDL_JoystickUpdate, or when pumping or polling for SDL events (via SDL_PumpEvents or SDL_PollEvent). Here is a listing of the new, public APIs, at present and subject to change: ------------------------------------------------------------ /** * Attaches a new virtual joystick. * Returns the joystick's device index, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nballs, int nbuttons, int nhats); /** * Detaches a virtual joystick * Returns 0 on success, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); /** * Indicates whether or not a virtual-joystick is at a given device index. */ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); /** * Set values on an opened, virtual-joystick's controls. * Returns 0 on success, -1 on error. */ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualBall(SDL_Joystick * joystick, int ball, Sint16 xrel, Sint16 yrel); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value); ------------------------------------------------------------ Miscellaneous notes on the initial patch, which are also subject to change: 1. no test code is present in SDL, yet. This should, perhaps, change. Initial development was done with an ImGui-based app, which potentially is too thick for use in SDL-official. If tests are to be added, what kind of tests? Automated? Graphical? 2. virtual game controllers can be created by calling SDL_JoystickAttachVirtual with a joystick-type of SDL_JOYSTICK_TYPE_GAME_CONTROLLER, with naxes (num axes) set to SDL_CONTROLLER_AXIS_MAX, and with nbuttons (num buttons) set to SDL_CONTROLLER_BUTTON_MAX. When updating their state, values of type SDL_GameControllerAxis or SDL_GameControllerButton can be casted to an int and used for the control-index (in calls to SDL_JoystickSetVirtual* functions). 3. virtual joysticks' guids are mostly all-zeros with the exception of the last two bytes, the first of which is a 'v', to indicate that the guid is a virtual one, and the second of which is a SDL_JoystickType that has been converted into a Uint8. 4. virtual joysticks are ONLY turned into virtual game-controllers if and when their joystick-type is set to SDL_JOYSTICK_TYPE_GAMECONTROLLER. This is controlled by having SDL's default list of game-controllers have a single entry for a virtual game controller (of guid, "00000000000000000000000000007601", which is subject to the guid-encoding described above). 5. regarding having to call SDL_JoystickUpdate, either directly or indirectly via SDL_PumpEvents or SDL_PollEvents, before new virtual-joystick state becomes active (as specified via SDL_JoystickSetVirtual* function-calls), this was done to match behavior found in SDL's other joystick drivers, almost all of which will only update SDL-state during SDL_JoystickUpdate. 6. the initial patch is based off of SDL 2.0.12 7. the virtual joystick subsystem is disabled by default. It should be possible to enable it by building with SDL_JOYSTICK_VIRTUAL=1 Questions, comments, suggestions, or bug reports very welcome!
Sam Lantinga 879f137a 2020-03-13T19:00:24 Added support for the older Xbox One S Bluetooth controller report format
Sam Lantinga d662a659 2020-03-13T19:00:22 Fixed crash if manufacturer or product string is NULL