Commit graph

10400 commits

Author SHA1 Message Date
Jools Wills
a44ca21306 debian package changes -
* update debian control/rules for retropie
 * split configure options onto multiple lines
 * disable tslib as it doesn't exist in Debian Jessie but does exist in Raspbian Jessie and we want to use the same binaries on both
 * correct configure option to enable opengles
 * added libx11-dev dependency for libsdl2-dev
2018-03-08 16:01:37 +00:00
Jools Wills
d24eba9c34 Revert "Linux joystick: Look at entire axis namespace for controls (thanks, "spaz16"!)."
This reverts commit 4cb7923f25.

see https://github.com/RetroPie/RetroPie-Setup/issues/1297
2018-03-08 16:01:37 +00:00
Stefan
e24d1ccab6 rpi video - Use dispmanx scaling (#1)
* Use dispmanx scaling
* There is the new SDL hint SDL_VIDEO_RPI_SCALE_MODE. There are three values.
 * The variable can be set to the following values:
 *   "0"       - Window resolution is desktop resolution.
 *               This is the behaviour of SDL <= 2.0.4. (default)
 *   "1"       - Requested video resolution will be scaled to desktop resolution.
 *               Aspect ratio of requested video resolution will be respected.
 *   "2"       - Requested video resolution will be scaled to desktop resolution
 *   "3"       - Integer scaling. dst_rect is an integral multiple of src_rect. Should prevent scaling artifacts.
* Add aspect ratio hint
2018-03-08 16:01:37 +00:00
Jools Wills
9a90520563 silence log output for unknown input 2018-03-08 16:01:37 +00:00
Sam Lantinga
36d733ccdd Added a mapping for the latest firmware for the Xbox One S controller on Android 2018-03-07 18:10:01 -08:00
Sam Lantinga
000fa72dee Include a USB VID/PID for Apple MFI controllers
This is just placeholder VID/PID, but allows code that works with VID/PID to identify the MFI controllers easily.
2018-03-07 18:09:58 -08:00
Sam Lantinga
b81da78518 Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened 2018-03-07 13:30:40 -08:00
Sam Lantinga
f0be85b8b3 Try to dynamically create a default Android game controller mapping based on the buttons and axes on the controller.
Include the controller USB VID/PID in the GUID where possible, as we do on other platforms.
2018-03-06 14:51:50 -08:00
Sam Lantinga
fd446f0973 Progress fixing bug 4100 - errors and warnings after changeset 11917
Ozkan Sezer 2018-03-02 20:02:37 UTC
http://hg.libsdl.org/SDL/rev/5ce3f8bf8381 resulted in an error and
two warnings when compiled with mingw.

1.  Error from SDL_windowstaskdialog.h:
In file included from src/video/windows/SDL_windowsmessagebox.c:29:0:
src/video/windows/SDL_windowstaskdialog.h:23:54: error: expected ')' before 'HWND'

This is fixed by removing unnecessary annotations:

2.  Warning from SDL_assert.c:
src/SDL_assert.c: In function 'SDL_ExitProcess':
src/SDL_assert.c:138:1: warning: 'noreturn' function does return

Indeed ExitProcess() is prototyped with DECLSPEC_NORETURN, but
TerminateProcess() is not.  This can be rectified by adding an
exit() call in there. Do NOTE, however, that requires building
with a libc:

3.  Warning from SDL_windowsmessagebox.c:
src/video/windows/SDL_windowsmessagebox.c: In function 'WIN_ShowMessageBox':
src/video/windows/SDL_windowsmessagebox.c:513:9: warning: 'nCancelButton' may be used uninitialized in this function

My lazy solution was manually initializing nCancelButton to 0.
2018-03-02 22:53:25 -08:00
Sam Lantinga
e1aee46bf4 Fixed bug 4101 - configure needs regenerating after changeset 11894 2018-03-02 22:48:15 -08:00
Sam Lantinga
2a361fa6ca Fixed setting the layer drawable size
Without this change the drawable had a size of 0 and the metal renderer asserted because the projection matrix wasn't set.
2018-03-02 12:08:18 -08:00
Ryan C. Gordon
c1f36d1993 windows: Restore patches for Task Dialogs and TerminateProcess().
2.0.8 has shipped, these can live in revision control now!
2018-03-02 14:10:25 -05:00
Sam Lantinga
98409804b0 Use the real controller name for game controllers on iOS and Apple TV 2018-03-02 10:56:21 -08:00
Sam Lantinga
2339412946 Added tag release-2.0.8 for changeset f1084c419f33 2018-03-01 09:32:53 -08:00
Sam Lantinga
ef5bf55e83 Added patch note for Android Studio support 2018-03-01 08:26:10 -08:00
Sam Lantinga
b0a8d98e3c Temporarily disabled fullscreen switching code on Android, until we can resolve bug 4096 - Enabling fullscreen on Android causes the app to toggle fullscreen mode continuously in a loop 2018-03-01 08:22:56 -08:00
Sam Lantinga
c36b7dd98c Added a patch note for OpenGL ES support on Mac 2018-03-01 08:08:20 -08:00
Ryan C. Gordon
df5f306a61 Back out Task Dialog and TerminateProcess patches for 2.0.8.
These can return to revision control once we ship.

--HG--
extra : histedit_source : a1e341365f4443905266d727b2005654ef1dcb8a%2Ca77cd7cf6988f57299c7e4e4b2f95afbc6ba6c5e
2018-02-28 10:39:41 -05:00
Ryan C. Gordon
85e9f16b44 windows: dos2unix'd messagebox code, and (hopefully) fixed on MingW. 2018-02-28 02:14:15 -05:00
Ryan C. Gordon
e886bb1351 windows: Message boxes use Task Dialogs if possible (thanks, Jack!).
This lets the message box have an icon. Unless the app has opted-in to using
the v6 common controls, though, this will fall back to the usual SDL message
boxes.
2018-02-28 01:54:22 -05:00
Ryan C. Gordon
0135882d92 assert: Use TerminateProcess() on Windows, vs ExitProcess (thanks, Jack!).
"What I have done is use TerminateProcess rather than ExitProcess.
ExitProcess will cause Microsoft's leak detection to continue, TerminateProcess
won't. It is also technically wrong to use ExitProcess in the case of aborting
the application.

Jack Powell
Twitter @jack9267"
2018-02-28 01:23:49 -05:00
Sam Lantinga
48f2328b4d Added patch note about the Vulkan Mac SDK 2018-02-26 08:39:25 -08:00
Mark Callow
fb91a23463 Support official Vulkan SDK for macOS.
This tries to load vulkan.framework or libvulkan.1.dylib before MoltenVK.framework
or libMoltenVK.dylib. In the previous version, layers would not work for applications
run-time loading the default library.
2018-02-25 23:02:09 -08:00
Sam Lantinga
d913b2d6d7 Fixed bug 4097 - Segmentation fault by SDL_CreateThreadWithStackSize
Dongsun Kim

Normal case
1. [thread 1] SDL_CreateThreadWithStackSize calls SDL_SYS_CreateThread.
2. [thread 1] If successful, it calls SDL_SemWait.
3. [thread 2] SDL_RunThread calls SDL_SYS_SetupThread, SDL_ThreadID, SDL_SemPost.
4. [thread 1] SDL_CreateThreadWithStackSize calls SDL_DestroySemaphore, SDL_free.

Crash case (Segmentation fault)
1. [thread 1] SDL_CreateThreadWithStackSize calls SDL_SYS_CreateThread.
2. [thread 1] If successful, it calls SDL_SemWait.
--> Error return due to SIGNAL(SYSTEM or Real Time) at sem_wait(pthread).
3. [thread 1] SDL_CreateThreadWithStackSize calls SDL_DestroySemaphore, SDL_free.
4. [thread 2] SDL_RunThread calls SDL_SYS_SetupThread, SDL_ThreadID, SDL_SemPost.
--> Segmentation fault at strlen or sem_post.
2018-02-25 19:51:34 -08:00
Olli Kallioinen
5babbd2ae6 cmake: Set debug library name suffix per target instead of setting it globally. Don't add a suffix on android 2018-02-25 19:22:47 +02:00
Ozkan Sezer
5f9f45f342 SDL_test_fuzzer.c: fix strict aliasing warnings by using a union. 2018-02-25 10:15:00 +03:00
Sam Lantinga
d8e2ed22db Moved Android patch note into the Android section 2018-02-24 09:09:20 -08:00
Sam Lantinga
507975a360 Fixed bug 4092 - CMake support for building everything in the "test" directory
Eric Wasylishen

Patch to support building the tests with cmake.
Disabled by default, use: "cmake .. -DSDL_TEST=YES" to enable the tests.

Tested on macOS 10.13 with the ninja, makefile, and Xcode generators, and Windows 10 with the Visual Studio 2017 generator.
2018-02-24 08:59:58 -08:00
Sam Lantinga
739eb4b610 Fixed bug 4091 - Undefined references to Android audio functions when SDL_AUDIO_DISABLED is on
Manuel Sabogal

If SDL is compiled with the Audio subsystem disabled there are some undefined references to the functions ANDROIDAUDIO_ResumeDevices and ANDROIDAUDIO_PauseDevices in the file src/video/android/SDL_androidevents.c.
2018-02-24 08:58:22 -08:00
Sam Lantinga
c71be88f69 Added patch note for Ryan's work 2018-02-24 08:42:04 -08:00
Sam Lantinga
5e85fbd95c Added missing file to tvOS build 2018-02-24 08:40:30 -08:00
Sam Lantinga
631aa4081c Fixed MinGW-w64 build 2018-02-24 08:23:44 -08:00
Sam Lantinga
d46e905a81 Updated documentation with API changes in SDL 2.0.8 2018-02-24 08:18:09 -08:00
Brandon Schaefer
0a93dbd9eb Backout the vulkan change in cd67e676bca7 breaks Mir builds 2018-02-23 19:12:04 -05:00
Brandon Schaefer
57b08e341c mir: Disable Mir by default as Mir supports Wayland clients
Also remove enabling VK support for Mir
2018-02-23 11:24:26 -05:00
Ryan C. Gordon
b014335598 Backed out changeset bd976b7b2b43
Apparently this still triggers a compiler warning, have to dig further.
2018-02-21 22:53:52 -05:00
Ryan C. Gordon
7d719ba6da android: apparently they fixed this header at some point. 2018-02-21 22:35:17 -05:00
Ryan C. Gordon
72332a396f vulkan: Possibly fix a compiler warning (-Wstrict-prototypes).
--HG--
extra : rebase_source : 55a8174bb2c9ddf257373ed4034284e9a77b5f51
2018-02-21 22:27:09 -05:00
Ryan C. Gordon
8d4ba86657 wasapi: let Windows do the resampling for us if possible.
--HG--
extra : histedit_source : d3b8d8c50b1158ecacd48fdd35090ffe24d61c81
2018-02-21 21:34:06 -05:00
Ryan C. Gordon
a636f0a41a wasapi: fixed typo in an assert message.
--HG--
extra : histedit_source : 50720952e1131985085ddf58c115123988472fb1
2018-02-21 21:34:35 -05:00
Ryan C. Gordon
0b9aeb9c4c windows: added WIN_IsWindows7OrGreater().
--HG--
extra : histedit_source : cf4acefd794427347dd94a72cb546b4d1da7022c
2018-02-21 21:36:10 -05:00
Ethan Lee
b55bb6ff48 Use new XInput mapping for Win10+ (Bugzilla #3960) 2018-02-21 12:42:30 -05:00
Mark Callow
f410bef6cc Fix high-dpi support on macOS and simplify it and iOS variant.
The detault drawableSize for a CAMetalLayer is its bounds x its scale.
So it is sufficient to set the *layer's* scale to the desired value.
2018-02-21 09:58:21 -08:00
Sam Lantinga
7d30836466 Fixed bug 4034 - Don't include _DllMainCRTStartup() if SDL_STATIC_LIB is defined. 2018-02-21 09:40:47 -08:00
Sam Lantinga
45d40a3639 Fixed bug 4088 - Fix Metal link errors with test programs in SDLTest.xcodeproj
Eric Wasylishen

The following patch adds Metal.framework to the "link binary with libraries" section of each test program, with "status" set to "optional", which fixes link errors on all of the test programs. I'm not sure if this is a correct fix - the fact that this was necessary might indicate the static SDL2.a library has a hard dependency on Metal.framework (?) - but it gets the test programs working in Xcode again.

It also adds testyuv_cvt.c to the testoverlay2 target, fixing a link error.
2018-02-20 09:04:31 -08:00
Sam Lantinga
fe063ee3f5 Actually, this is needed for building with Visual Studio with both /MT and /MD.
With the previous change, I get:
1>     Creating library C:\projects\SDL\VisualC\Win32\Debug\SDL2.lib and object C:\projects\SDL\VisualC\Win32\Debug\SDL2.exp
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
2018-02-18 09:09:56 -08:00
Sam Lantinga
01e66afef6 Fixed bug 4034 - Do we really need _DllMainCRTStartup() in every Windows build?
Andreas Falkenhahn

In src/SDL.c there is this code:

_DllMainCRTStartup(HANDLE hModule,

...

The comment says that this is needed on Watcom C for some reason but why is it included then when building with Visual C as well? Shouldn't it be only included when compiling on Watcom C then?

I'm asking because this code caused me a lot of headaches because I'm building a DLL that contains SDL and I link using /MT and the _DllMainCRTStartup() symbol obviously led to lots of trouble but it wasn't clear to me where the problem was because all I got from the linker was:

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

So I had to got through each and every object to see what the culprit was. See here for the full story:
48177067 (48177067)

So if it isn't necessary on Visual C, please just leave that symbol out on Visual C so that it no longer leads to any trouble. Thanks.
2018-02-18 08:57:01 -08:00
Ryan C. Gordon
03495f9a7f pthread: fix error code checks (thanks, Andreas!).
Most pthread functions return 0 on success and non-zero on error, but those
errors might be positive or negative, so checking for return values in the
Unix style, where errors are less than zero, is a bug.

Fixes Bugzilla #4039.
2018-02-17 23:57:57 -05:00
Ryan C. Gordon
c167d6f645 yuv: patched to compile. 2018-02-17 20:18:48 -05:00
Ryan C. Gordon
86cd44db04 yuv: fixed variable declaration shadowing warnings.
Fixes Bugzilla #4062.

--HG--
extra : rebase_source : 3bb1d5bb198a2f9ec55ac2006569e80205e4a119
2018-02-17 20:10:13 -05:00