summaryrefslogtreecommitdiff
path: root/src/haptic
AgeCommit message (Collapse)AuthorFilesLines
2018-01-03Updated copyright for 2018Sam Lantinga14-14/+14
2017-12-11Fixed bug 3999 - Build failed when try to build with configure script for ↵Sam Lantinga1-2/+1
Android
2017-08-28Renaming of guard header names to quiet -Wreserved-id-macroSam Lantinga1-3/+3
2017-08-14Fixed Android build warningSam Lantinga1-1/+1
2017-08-12Fixed bug 3191 - haptic system on android?Sam Lantinga3-0/+371
Patch provided by jintiao and Milan Nikolic, thanks!
2017-06-21xinput: use the full range of the haptic motors (thanks, Trent!).Ryan C. Gordon1-2/+3
XInput goes from 0 to 64k; we were feeding it values in the range of 0 to 32k. Fixes Bugzilla #3002.
2017-06-11linux: Changed internal functions to be static.Philipp Wiesemann1-2/+2
2017-02-13windows: Try to unify all the GUID comparison code into a core helper function.Ryan C. Gordon1-18/+9
There are likely several more I missed.
2017-01-18Fixed bug 3561 - Re-acquire device before playing effects if needed.Sam Lantinga1-0/+13
Mathieu Laurendeau Check the result of IDirectInputEffect_SetParameters and re-acquire the device to solve concurrency issues.
2017-01-01Updated copyright for 2017Sam Lantinga13-13/+13
2016-11-20Renaming of guard header names to quiet -Wreserved-id-macroSam Lantinga1-3/+3
Patch contributed by Sylvain
2016-11-16Fixed empty parameter list in signatures of internal functions.Philipp Wiesemann3-3/+3
2016-11-13Fixed unresolved symbol on Visual StudioSam Lantinga1-2/+2
2016-11-13Patch from Sylvain to fix clang warningsSam Lantinga2-2/+2
2016-10-07Implemented SDL_GetHintBoolean() to make it easier to check boolean hintsSam Lantinga1-2/+1
2016-10-04Fixed bug 3021 - HapticOpenFromJoystick() problemsSam Lantinga1-8/+9
Joe Thompson With Direct Input device (MOMO Steering Wheel w/FF) with SDL 2.0.3, SDL_HapticOpenFromJoystick() would fail. (Can't set exclusive mode) Now with 2.0.4 rc1, SDL_HapticOpenFromJoystick() succeeds but the the returned SDL_Haptic* cannot be used. Calls to SDL_HapticNewEffect() fail with "Haptic error Unable to create effect" If SDL_HapticOpen() is used instead of HapticOpenFromJoystick(), the device is usable. Calls to HapticNewEffect() succeed with the exact same parameters as the previous failing call. I have attached a proposed patch for this issue. When using SDL_HapticOpenFromJoystick(), the original code did not (re)enumerate the axes. This returned a new haptic device with 0 axes. Later, when a new effect is created, SDL_SYS_SetDirection() would set the flags to include DIEFF_SPHERICAL, regardless of what the caller actually set. (see Line 566 in SDL_dinputhaptic.c). This would cause the SDL_HapticNewEffect() to fail (or interpret the coordinates incorreclty.) The patch moves the call to IDirectInputDevice8_EnumObjects() outside of the if() block so that the axes are (re)enumerated for the new haptic device. Note: For steering wheels it is common for the joystick to have multiple axes (ie steering, throttle, brake), but the haptic portion of the joystick usually only applies to steering.
2016-10-01Fixed build warnings and errorsSam Lantinga1-1/+1
2016-07-20Linux: Fixed memory leak in haptic implementation (thanks, Martin!).Philipp Wiesemann1-1/+1
Fixes Bugzilla #3238.
2016-04-12Patched to compile on various platforms.Ryan C. Gordon1-1/+1
2016-04-12threads: Move SDL's own thread creation to a new internal API.Ryan C. Gordon1-10/+2
This allows us to set an explicit stack size (overriding the system default and the global hint an app might have set), and remove all the macro salsa for dealing with _beginthreadex and such, as internal threads always set those to NULL anyhow. I've taken some guesses on reasonable (and tiny!) stack sizes for our internal threads, but some of these might turn out to be too small in practice and need an increase. Most of them are simple functions, though.
2016-01-05Use SDL's stdinc functions instead of C runtime calls.Ryan C. Gordon1-1/+1
2016-01-03Remove almost all instances of "volatile" keyword.Ryan C. Gordon3-5/+5
As Tiffany pointed out in Bugzilla, volatile is not useful for thread safety: https://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/ Some of these volatiles didn't need to be, some were otherwise protected by spinlocks or mutexes, and some got moved over to SDL_atomic_t data, etc. Fixes Bugzilla #3220.
2016-01-02Updated copyright to 2016Sam Lantinga13-13/+13
2015-09-30Fix crash on controller hotplug on linux.Sam Lantinga1-3/+6
CR: Sam
2015-06-16Haptic/Linux: Keep track of device numbers properly to track duplicates.Ryan C. Gordon1-14/+6
Fixes Bugzilla #3014.
2015-06-14Fixed bug 2953 - Crash due to a bad cleanup in the SDL_SYS_HapticQuit functionSam Lantinga6-3/+14
Technically this is caused by the haptic devices not being closed at quit time, which we need to fix anyway, but this is a bandaid for now.
2015-06-08Linux: Fixed not needed call to close() on error.Philipp Wiesemann1-1/+1
It was called if file descriptor was none and -1.
2015-06-07Maybe patched to compile on some Windows configurations.Ryan C. Gordon1-0/+2
(Maybe) Fixes Bugzilla #3001.
2015-05-28I think this will be the time...Ryan C. Gordon2-0/+2
2015-05-28Still trying to get this to compile...Ryan C. Gordon2-2/+2
2015-05-28More patching to compile...Ryan C. Gordon2-4/+8
2015-05-28Move tests from SDL_config higher up in Windows joystick/haptic code.Ryan C. Gordon2-7/+5
Fixes Bugzilla #2932.
2015-05-26Whoops, fix the static analysis fix.Ryan C. Gordon1-1/+1
2015-05-26Darwin haptic: Fixed a static analysis warning if axes==0.Ryan C. Gordon1-30/+33
2015-05-26Updated the copyright year to 2015Sam Lantinga13-13/+13
2015-04-11Mac: Fixed typo in two error messages.Philipp Wiesemann1-2/+2
2015-02-19Remove unnecessary parentheses and an unnecessary free() of a NULL pointer.Ryan C. Gordon1-2/+1
(Thanks, Simon!) Fixes Bugzilla #2881.
2014-12-11Removed extern declaration of not existing SDL_numhaptics from internal header.Philipp Wiesemann1-6/+0
2014-12-04Replaced free() with SDL_free() because related allocation also uses wrapper.Philipp Wiesemann2-3/+3
2014-11-29Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase ↵Sam Lantinga1-4/+2
handled as time instead of angle; + direction clarification Elias Vanderstuyft Remove the dependency of the calculation of Linux "phase" on "period", currently the "phase" parameter is interpreted as a time shift, instead of a phase shift. The Linux input documentation is not clear about the exact units of the "phase" parameter (see http://lxr.free-electrons.com/source/include/uapi/linux/input.h?v=3.17#L1075 ), but we're about to standardize the 'phase shift' interpretation into the Linux input documentation, since this will ease the job of a driver to recalculate the effect's state when the user dynamically updates the "period" parameter.
2014-11-29Fixed bug 2766 - Haptic coding bugs and fixes for Linux FF: periodic.phase ↵Sam Lantinga1-0/+2
handled as time instead of angle; + direction clarification Elias Vanderstuyft It's not obvious from the general "haptic direction" description what the SDL direction actually means in terms of force magnitude sign, currently its meaning is only reflected by the example.
2014-09-17Haptic: Deal with negative periodic magnitudes (thanks, Elias!).Ryan C. Gordon2-4/+8
A negative periodic magnitude doesn't exist in Windows' and MacOS' FF APIs The periodic magnitude parameter of the SDL Haptic API is based on the Linux FF API, so it means they are not directly compatible: 'dwMagnitude' is a 'DWORD', which is unsigned. Fixes Bugzilla #2701.
2014-08-16Haptic: Fix clamping bugs on Windows, by using the Darwin haptics code.Ryan C. Gordon1-13/+16
Thanks, Elias! Partially fixes Bugzilla #2686.
2014-08-16Haptic: Fix the saturation and deadband parameters' available range.Ryan C. Gordon3-14/+12
There was a misconception that Linux's saturation and deadband parameters - on which the corresponding SDL parameters were based - use only half of the possible range. Thanks, Elias! Partially fixes Bugzilla #2686.
2014-08-16Haptic: Explicitly avoid floating point arithmetic if it's not needed.Ryan C. Gordon1-4/+9
Thanks, Elias! Partially fixes Bugzilla #2686.
2014-08-16Haptic: DInput's POLAR direction actually matches Linux's direction.Ryan C. Gordon1-6/+6
Thanks, Elias! Partially fixes Bugzilla #2686.
2014-08-16Haptic: Don't interpret a direction of polar 35999 as "unsupported type".Ryan C. Gordon1-18/+18
(or linux-direction 0xFFFF) Thanks, Elias! Partially fixes Bugzilla #2686.
2014-07-07Fixed bug 2631 - Mac: minor code cleanupSam Lantinga1-42/+41
Alex Szpakowski Some minor changes to the Mac-specific backend code: - Fixed up some code style issues (mostly brace style inconsistencies). - Fixed a compiler warning in SDL_cocoaevents.m. - Removed some useless code now that the 10.7 SDK is required to build SDL. - Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
2014-07-07Fixed mingw64 build and warningsSam Lantinga3-2/+7
2014-07-04Fixed haptic refcount bug (thanks David Ludwig!)Sam Lantinga1-1/+1