Commit graph

9461 commits

Author SHA1 Message Date
Sam Lantinga
f70131004a Fixed updated return value for SDL_GL_SwapWindow()
Ozkan Sezer

http://hg.libsdl.org/SDL/rev/00fe449fbefe seems to have
forgotten removing the return from SDL_dynapi_procs.h, and this patch
does that. Without it, MSVC warns:
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow_DEFAULT' : 'void' function returning a value
c:\sdl2\src\dynapi\SDL_dynapi_procs.h(598) : warning C4098:
'SDL_GL_SwapWindow' : 'void' function returning a value
2016-12-12 09:19:48 -08:00
Sam Lantinga
4f1d76f685 Fixed edid parsing code for older gcc compilers
Ozkan Sezer

This adds the name 'ad' to two unnamed unions in edid.h
and adjusts edid-parse.c for it.  Nameless unions are not supported in
ancient gcc, which I happened to use on one of my ancient setups.
2016-12-12 09:18:42 -08:00
Sam Lantinga
192fc4cdb5 Fixed ABI, don't change the return type of SDL_GL_SwapWindow() 2016-12-11 12:01:44 -08:00
Sam Lantinga
cd2ede0038 Fixed creating a renderer on the dummy driver on Mac OS X 2016-12-11 12:01:01 -08:00
Sam Lantinga
8a92aa190f Fixed crash when creating a dummy window on Mac OS X 2016-12-11 11:45:33 -08:00
David Ludwig
bfc9b8c565 WinRT: build fixes
These fixes are lumped into two categories:

1. add new file, SDL_dataqueue.c, to UWP/WinRT build-inputs (via MSVC project
   files)

2. implement a temporary, hack-fix for a build error in SDL_xinputjoystick.c.
   Win32's Raw Input APIs are, unfortunately, not available for use in UWP/WinRT
   APIs.  There does appear to be a replacement API, available in the
   Windows.Devices.HumanInterfaceDevice namespace.

   This fix should be sufficient to get SDL compiling again, without affecting
   Win32 builds, however using the UWP/WinRT API (in UWP/WinRT builds) would
   almost certainly be better (for UWP/WinRT builds).

   TODO: research Windows.Devices.HumanInterfaceDevice, and use that if and as
   appropriate.
2016-12-10 15:23:17 -05:00
Sam Lantinga
4ac0f03b8b PP_OK isn't available in the NaCl build environment on buildbot. It's defined as 0 2016-12-09 05:19:31 -08:00
Sam Lantinga
311313d874 Fixed a bunch of SwapWindow calls that needed their return value updated 2016-12-09 05:12:27 -08:00
Sam Lantinga
dc3839db98 Fixed X11 OpenGL ES build 2016-12-09 05:04:18 -08:00
Sam Lantinga
cb997e1997 Fixed build for EGL platforms 2016-12-09 05:00:35 -08:00
Sam Lantinga
a4c48157ef Added support for the XiaoMi Game Controller 2016-12-09 04:57:54 -08:00
Sam Lantinga
9fc407dda0 Only print out the controller mappings if we're not going to test a controller 2016-12-09 04:17:10 -08:00
Sam Lantinga
d77e4ac317 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status
Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
2016-12-09 01:47:43 -08:00
Sam Lantinga
ae84e0ada2 Fixed bug 3512 - Memory leak of SDL_Joystick axes_zero array
Benjamin Harris

Found with valgrind and confirmed in the 2.0.5 source code.
One-line fix in SDL_JoystickClose?
2016-12-09 01:29:52 -08:00
Sam Lantinga
6ece64092f Protect the game controller API the same way the joystick API is protected from multi-threaded access 2016-12-08 10:13:45 -08:00
Sam Lantinga
400ed31043 Added the guide button for the NVIDIA Shield Controller 2016-12-07 11:41:20 -08:00
Sam Lantinga
1bc9b5f358 Removed unneeded warning when running from Visual Studio 2016-12-07 11:02:02 -08:00
Sam Lantinga
1886965160 Added support for XBox One controllers on Mac OS X, using the driver at: https://github.com/360Controller/360Controller/releases 2016-12-06 14:22:28 -07:00
Ryan C. Gordon
638cb97a63 xcode: Make sure SDL_dataqueue sources are included in all targets. 2016-12-06 13:33:02 -05:00
Ryan C. Gordon
6b6da8150e xcode: updated macOS and iOS project files with SDL_dataqueue sources. 2016-12-06 12:30:31 -05:00
Ryan C. Gordon
887f7da383 audio: Fixed compiler warnings. 2016-12-06 12:23:17 -05:00
Ryan C. Gordon
1f9dbc5f66 Refactored the audio queueing code to a generic SDL_DataQueue interface.
This is not a public API (at the moment), but we will be needing this for
other internal things soon.

--HG--
extra : rebase_source : a9cc678783f19b02978f9b09f77b6a4ae9759a92
2016-12-06 02:23:54 -05:00
Ryan C. Gordon
a43f4155bb Added SDL_VARIABLE_LENGTH_ARRAY so this #ifdef is localized to one place.
--HG--
extra : rebase_source : d3e161c0ca22ae672ad540a4febef47e141e37c1
2016-12-06 02:20:58 -05:00
Sam Lantinga
5ab2eefa0d Fixed bug 3508 - variably modified ‘SDL_dummy_size’ at file scope in test/testatomic.c
Ciro Santilli

GCC 6, Ubuntu 16.10, cd test; ./configure; make

/bin/sh config.status Makefile
config.status: creating Makefile
gcc -o loopwave loopwave.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
gcc -o testatomic testatomic.c -g -O2 -D_REENTRANT -I/usr/include/SDL2 -DHAVE_OPENGLES2 -DHAVE_OPENGL -DHAVE_SDL_TTF -g -lSDL2_test -lSDL2
In file included from /usr/include/SDL2/SDL_main.h:25:0,
                 from /usr/include/SDL2/SDL.h:32,
                 from testatomic.c:14:
/usr/include/SDL2/SDL_stdinc.h:261:20: error: variably modified ‘SDL_dummy_size’ at file scope
        typedef int SDL_dummy_ ## name[(x) * 2 - 1]
                    ^
testatomic.c:106:1: note: in expansion of macro ‘SDL_COMPILE_TIME_ASSERT’
 SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */
 ^~~~~~~~~~~~~~~~~~~~~~~
Makefile:114: recipe for target 'testatomic' failed
make: *** [testatomic] Error 1

If I remove the line SDL_COMPILE_TIME_ASSERT(size, CountTo>0); /* check for rollover */ it works, lazy to figure out the best way to do this.
2016-12-06 00:40:09 -08:00
Sam Lantinga
89f58f3352 Fixed SDL always being built because of missing headers in the project. 2016-12-05 21:28:27 -08:00
Sam Lantinga
48558b6b2a Added support for the Hori Fighting Commander 4 2016-12-03 08:39:21 -08:00
Sam Lantinga
a5949480a1 Fixed crash at startup 2016-12-03 09:59:43 -08:00
Sam Lantinga
97a8eabaea Added Linux mapping for the DragonRise Inc. Generic USB Joystick 2016-12-03 00:40:13 -08:00
Sam Lantinga
476ea07d1b Fixed compile warning on Visual Studio 2016-12-02 22:18:05 -08:00
Sam Lantinga
065ab77fd3 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
d1b2ffe485 Fixed missing prototypes on Android, patch from Sylvain 2016-12-02 02:25:12 -08:00
Sam Lantinga
27eff4b547 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
55695ad162 Added Linux controller mapping for the Nostromo n45 Dual Analog Gamepad 2016-12-01 07:31:08 -08:00
Sam Lantinga
36e2a768d4 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
8ee02fe216 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
d56f4e599f Fixed the controller mappings for the OUYA controller 2016-11-30 12:58:03 -08:00
Sam Lantinga
9b7dc58b03 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
98f3c67dae Added support for the DS4 USB Wireless Adaptor 2016-11-30 12:25:19 -08:00
Philipp Wiesemann
bcb68c55cf Updated documentation in header file. 2016-11-30 23:31:36 +01:00
Philipp Wiesemann
a5cd9d9fa1 Fixed warning about storing an unused value.
Found by buildbot.
2016-11-30 23:31:23 +01:00
Sam Lantinga
428b0082bf Add the controller mappings to the linked list in order 2016-11-29 22:02:37 -08:00
Sam Lantinga
a31f3d2c25 Added an API to iterate over game controller mappings 2016-11-29 06:36:57 -08:00
Sam Lantinga
1e59d959f0 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
070b6b0d93 Made it safe to update joysticks from multiple threads, fixes crash in Steam 2016-11-29 05:04:42 -08:00
Sam Lantinga
7000baacf0 Added fcitx-libs-dev to debian build dependencies, for Fcitx IME support 2016-11-28 08:05:45 -08:00
Sam Lantinga
e10c0baa5f Added debian changelog entry for SDL 2.0.5 2016-11-28 07:34:25 -08:00
Sam Lantinga
b91bde8a00 once more - iterating on this is annoying 2016-11-26 10:26:36 -08:00
Sam Lantinga
7e7f8e1aa6 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
5ffd534bc4 tap should default to disabled, not enabled 2016-11-26 10:26:26 -08:00
Sam Lantinga
fabb4c5e9e 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