Commit Graph

6229 Commits

Author SHA1 Message Date
Sam Lantinga
7bd32ecc46 Added SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the speed of the mouse.
This currently doesn't affect absolute motion, which would need to be implemented on each windowing system so the cursor matches the reported mouse coordinates.
2016-12-02 21:01:13 -08:00
Sam Lantinga
f0ca0a5183 Fixed missing prototypes on Android, patch from Sylvain 2016-12-02 02:25:12 -08:00
Sam Lantinga
d0ad2d6288 Fixed bug 3305 - Fixed TextInput status when the keyboard was dismissed with the dismiss key on the iPad
Diego

I was previously unaware that rotating the device to a different orientation when the keyboard is shown causes a keyboardWillHide followed by a keyboardWillShow notification. The previous patch would then mistakenly StopTextInput when rotating. This patch fixes that by checking if the device is rotating before stopping text input.
2016-12-02 02:21:35 -08:00
Sam Lantinga
44e8419b93 Added Linux controller mapping for the Nostromo n45 Dual Analog Gamepad 2016-12-01 07:31:08 -08:00
Sam Lantinga
cd3f06dbbd Fixed bug 3503 - osx builds don't run on 10.6 as of rev. 10651
Ozkan Sezer

With rev. 10651, i.e. http://hg.libsdl.org/SDL/rev/f0065b8e6541 ,
SDL2 - OS X builds fail to run on 10.6 (my setup: i686 / 10.6.8)
because the symbol _IOPMAssertionCreateWithDescription is missing.
The SDK listing it for 10.7+ does seem correct.  Reverting r10651
and rebuilding makes it to function again.
2016-12-01 11:52:47 -08:00
Sam Lantinga
5a3f134b94 Fixed bug 3340 - SDL_BlitScaled causes access violation in some cases.
Simon Hug

The SDL_BlitScaled function runs into an access violation for specific blit coordinates and surface sizes. The attached testcase blits a 800x600 surface to a 1280x720 surface at the coordinates -640,-345 scaled to 1280x720. The blit function that moves the data then runs over and reads after the pixel data from the src surface causing an access violation.

I can't say where exactly it goes wrong, but I think it could have something to do with the rounding in SDL_UpperBlitScaled. final_src.y is 288 and final_src.h is 313. Together that's 601, which I believe is one too much, but I just don't know the code enough to make sure that's the problem.

Sylvain

I think this patch fix the issue, but maybe it's worth re-writing "SDL_UpperBlitScaled" using SDL_FRect.
2016-11-30 22:06:05 -08:00
Sam Lantinga
e1b2dba100 Fixed the controller mappings for the OUYA controller 2016-11-30 12:58:03 -08:00
Sam Lantinga
827c5b155f Added PS4 controller entries for the new Sony HID driver
https://git.kernel.org/cgit/linux/kernel/git/jikos/hid.git/log/?h=for-4.10/sony
2016-11-30 12:34:50 -08:00
Sam Lantinga
e7509d309c Added support for the DS4 USB Wireless Adaptor 2016-11-30 12:25:19 -08:00
Philipp Wiesemann
6a362ee4bb Fixed warning about storing an unused value.
Found by buildbot.
2016-11-30 23:31:23 +01:00
Sam Lantinga
dfcabb1a46 Add the controller mappings to the linked list in order 2016-11-29 22:02:37 -08:00
Sam Lantinga
f660677b48 Added an API to iterate over game controller mappings 2016-11-29 06:36:57 -08:00
Sam Lantinga
f7eea9848d Avoid conflicts with multiple versions of udev by first trying the library that is linked with the executable, if any, and then picking the one that is in the build environment.
This fixes joystick detection for applications using the Steam Linux Runtime
2016-11-29 05:34:20 -08:00
Sam Lantinga
6afabd76ed Made it safe to update joysticks from multiple threads, fixes crash in Steam 2016-11-29 05:04:42 -08:00
Sam Lantinga
ade9dfdf85 once more - iterating on this is annoying 2016-11-26 10:26:36 -08:00
Sam Lantinga
38bace28fb if the tap is explicitly disabled by code or by another program, let it remain disabled! this is different than the automatic "event tap was too slow therefore we stopped processing it" timeout which we want to re-enable after. 2016-11-26 10:26:32 -08:00
Sam Lantinga
d834bb5ef6 tap should default to disabled, not enabled 2016-11-26 10:26:26 -08:00
Sam Lantinga
5c3ea9fa3e SDL for Mac - only enable global event tap when actually necessary (app has focus and has requested relative mouse mode or has asked for a mouse grab). in other situations the event tap impacts system performance and battery life with no benefit. 2016-11-26 10:26:22 -08:00
Ryan C. Gordon
ef3cd43f79 macOS: removed deprecated UpdateSystemActivity() call.
The non-deprecated approach (IOPMAssertion) already exists in SDL, and is
available in Mac OS X 10.6 and later (although it was incorrectly listed as
10.7 and later in SDL). Since SDL now requires 10.6 or later, this is no
longer conditionally used.
2016-11-25 00:13:13 -05:00
Ryan C. Gordon
6521db4fee Fixed all known static analysis bugs, with checker-279 on macOS. 2016-11-24 21:41:09 -05:00
Sam Lantinga
77ddff913b Guess the USB VID/PID of XInput devices 2016-11-24 12:24:22 -08:00
Sam Lantinga
14e3231663 We are comparing 16-bit values 2016-11-24 11:53:23 -08:00
Ryan C. Gordon
ca453bb681 Pacify some GCC strict-aliasing compiler warnings. 2016-11-23 21:52:48 -05:00
Sam Lantinga
261e994ebe Fixed XBox One S controller mapping for firmware revision 3.1.1221.0, including back and guide buttons 2016-11-23 06:54:19 -08:00
Ryan C. Gordon
67072748a7 Still more compiler warning fixes for various platforms. 2016-11-23 17:20:28 -05:00
Ryan C. Gordon
4cdffc800c Fixed more compiler warnings. 2016-11-23 11:49:26 -05:00
Ryan C. Gordon
45c72a176b directsound: fixed compiler warnings. 2016-11-23 10:51:44 -05:00
Sam Lantinga
1bd16ec940 The XBox One S controller sends keys outside the standard joystick button range 2016-11-22 22:14:28 -08:00
Sam Lantinga
4a94f04278 Added mapping for XBox One S controller firmware version 3.1.1221.0 2016-11-22 04:42:07 -08:00
Ryan C. Gordon
484ed1dc30 cpuinfo: fix SDL_HasNEON() on older iOS devices, fixed C++ comment. 2016-11-21 20:35:59 -05:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
a097bc3ca3 Fixed warning building under mingw, patch contributed by Sylvain 2016-11-20 21:29:27 -08:00
Sam Lantinga
840200630a Fixed bug 3494 - SDL_test_fuzzer.c fails compile since r10604
Ozkan Sezer

As of hg rev. 10604 (http://hg.libsdl.org/SDL/rev/27d0fb08d755),
SDL_test_fuzzer.c fails to build again
2016-11-20 21:24:09 -08:00
Sam Lantinga
c6e13cd484 Fixed bug 3486 - Can't get HINSTANCE of my window
realitix

SDL2 allows to create widow and to get information through SDL_SysWMinfo.
But it misses something, with Vulkan, you need the HWND and HINSTANCE of the window for Win32 system.
Sadly, SDL2 provides only HWND but not HINSTANCE.

In some context, it can be difficult to get the HINSTANCE, indeed, I'm using pySDL2 (Python) and I can only access properties that SDL2 gives me.
I have to use a dirty trick like that to get the HINSTANCE:  (https://raw.githubusercontent.com/bglgwyng/pyVulkan/master/examples/win32misc.py)
2016-11-20 21:18:55 -08:00
Philipp Wiesemann
df55bace19 Fixed two memory leaks if added game controller mapping has lower priority.
Found by buildbot.
2016-11-19 23:27:37 +01:00
Philipp Wiesemann
3f55f0f3cb Windows: Fixed crash if using current SDL_GetWindowWMInfo() from older programs. 2016-11-18 00:06:09 +01:00
Philipp Wiesemann
2035106f7a Wayland: Fixed file descriptor leaks if device was not initialized. 2016-11-18 00:05:54 +01:00
Philipp Wiesemann
70f3f843fd Emscripten: Fixed handling of deactivated mouse events.
SDL_GetEventState() was called with a button state instead of an event type.
2016-11-18 00:05:28 +01:00
Ryan C. Gordon
9c4bef3bd7 cpuinfo: patched to compile for getauxval() path. 2016-11-17 17:03:43 -05:00
Ryan C. Gordon
7854221f46 cpuinfo: more patching for Android. Legacy platform targets are a pain. 2016-11-17 16:10:32 -05:00
Ryan C. Gordon
f2eb8732e4 cpuinfo: Patched to compile on Android, Linux. 2016-11-17 16:04:00 -05:00
Ryan C. Gordon
6774892f96 cpuinfo: patched to compile.
Nothing quite like experimentation via Buildbot!  :/
2016-11-17 16:01:59 -05:00
Ryan C. Gordon
e387dd428b cpuinfo: more work on SDL_HasNEON(). 2016-11-17 15:57:58 -05:00
Ryan C. Gordon
3e7fc78c4c cpuinfo: silence compiler warnings on non-Intel CPU architectures. 2016-11-17 01:41:56 -05:00
Ryan C. Gordon
c9a3d7c87b cpuinfo: disable NEON detection on Android for now.
Will fix this properly soon.
2016-11-17 01:34:18 -05:00
Ryan C. Gordon
bb52f8ccb0 cpuinfo: more robust ARM preprocessor checks. 2016-11-17 01:26:56 -05:00
Ryan C. Gordon
162885911a cpuinfo: first attempt at SDL_HasNEON() implementation. 2016-11-17 01:15:16 -05:00
Ryan C. Gordon
54d66342e6 cpuinfo: Removed code duplication, cached CPUID details. 2016-11-16 22:49:04 -05:00
Philipp Wiesemann
e81616f396 Wayland: Fixed memory leak if output retrieval failed.
Found by Cppcheck.
2016-11-16 22:09:40 +01:00
Philipp Wiesemann
a85facd73d Fixed empty parameter list in signatures of internal functions. 2016-11-16 22:08:51 +01:00