Commit graph

10645 commits

Author SHA1 Message Date
Ryan C. Gordon
a5187f96e2 x11: Correctly restore previous GL context after sacrificial context is done. 2017-09-01 14:08:09 -04:00
Ryan C. Gordon
736a5a3ed0 x11: don't try to make a NULL GL context current when we already did that. 2017-09-01 14:00:11 -04:00
Ryan C. Gordon
bb79b54f02 x11: Clean up sacrificial GL context code.
Check for failures, restore any previously-current context.
2017-09-01 13:57:40 -04:00
Ryan C. Gordon
6364eeecf2 x11: Make a sacrificial glX context to check for extensions during init.
This is necessary because we need to see if GLES compat extensions exist.

All of this code (including ShouldUseTextureFramebuffer()) should be
revisited after 2.0.6 ships; ideally we don't make throwaway contexts if
we can avoid it...but maybe we can't. I hear Vulkan is pretty cool.

Fixes Bugzilla #3725.

--HG--
extra : amend_source : 77a9461044721501192684414d7dc757e677691f
2017-09-01 13:27:53 -04:00
Alex Szpakowski
4ae6c39788 macOS: Update controller mapping of Steelseries Stratus XL to account for reversed thumbstick y-axis values (bug #3483). 2017-08-31 22:07:28 -03:00
Alex Szpakowski
60f43da150 macOS: Fix menubar items being enabled when they shouldn't be. 2017-08-31 21:34:29 -03:00
Alex Szpakowski
b3d4bde6d0 Code style cleanup in the Cocoa and UIKit vulkan files. 2017-08-31 21:26:13 -03:00
Alex Szpakowski
ef384efe5a macOS: Prevent unwanted native fullscreen (Spaces) toggles when the window is in fullscreen or isn't resizable. Fixes bug #3691. 2017-08-31 21:13:32 -03:00
Sam Lantinga
5c173c2517 Fixed bug 3791 - SDL_bits.h: __builtin_clz is supported in gcc >= 3.4
Ozkan Sezer

__builtin_clz is supported in gcc >= 3.4. The following patchlet adjusts
SDL_bits.h for it.
2017-08-31 15:17:59 -07:00
Sam Lantinga
0dadd6b804 Update Android SDK required to API level 16
Sylvain

Some API 16 methods are used (InputDevice: getDescriptor(), getVibrator()), so we need to compile at least with SDK API 16. Hence default.properties and project.properties have been modified to use android-16.

There are also some modification to SDLActivity.java not to use getVibrator() if we run under API 16. And not to check to presence of hasVibrator() if we are under API 11.
-some hard-coded constant can be expandend.
- rename a local variable (hasVibrator to hasVibratorService)
2017-08-31 15:12:08 -07:00
Sam Lantinga
f3c99e56d3 Fixed bug 3483 - Steelseries Nimbus MFi controller reversed Y-axis analog stick
benjamin.feng

Probable underlying cause: https://bugzilla.libsdl.org/show_bug.cgi?id=3124#c5

"If you download and build the HID Calibrator sample you can see that these are totally legitimate HID devices (except for inverting the Y-axis of joysticks, which is contrary to the HID specification but does make them more compatible with games compiled expecting XBOX controllers)."
2017-08-30 23:30:24 -07:00
Sam Lantinga
3ef9b11d46 Convert tabs to spaces in game controller database entries 2017-08-30 23:02:39 -07:00
Sam Lantinga
482731c88a Fixed bug 3789 - Android : small clean up
Sylvain

Since https://hg.libsdl.org/SDL/rev/a8c29f5b679f
SDL_android_main.c is empty and then produce a warning
nativeInit does not exist and dont need to be mark undefined
2017-08-30 14:25:01 -07:00
Sam Lantinga
5330567c7e Moved haptic source files into the proper folder 2017-08-30 09:44:38 -07:00
Sam Lantinga
e25675582a Fix QNX build - prioritize system EGL headers over the Khronos ones 2017-08-30 00:40:06 -07:00
Sam Lantinga
26a66653f0 Added some missing render capability flags 2017-08-29 23:14:39 -07:00
Sam Lantinga
1b6d6467db Fixed line breaks in verbose test logging output 2017-08-29 23:12:26 -07:00
Sam Lantinga
6ba1d5eed3 Added some debug messaging for previously unhandled events 2017-08-29 22:52:17 -07:00
Sam Lantinga
78c184a3e0 The dummy video driver check is now covered by explicitly checking for cocoa above. 2017-08-29 22:24:59 -07:00
Sam Lantinga
13fe9240dd Fixed bug 3616 - SDL_GL_CreateContext fails with SDL_GL_CONTEXT_DEBUG_FLAG and ANGLE/GLES 2.0
Colin Barrett

Using the pre-built x86 devel libs from here:
https://www.libsdl.org/release/SDL2-devel-2.0.5-VC.zip

If I have:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);

and I'm using ANGLE/(a GL driver that doesn't provide an ES2 context) such that SDL_EGL_CreateContext is called by SDL_GL_CreateContext, I get the error "Could not create EGL context (context attributes are not supported)" and no context is created.

Looking at the code in SDL_EGL_CreateContext - if gl_config.flags is non-zero, it looks like the code in the section guarded with "#ifdef EGL_KHR_create_context" should be executed - but it apparently isn't.

Is it possible this section hasn't been compiled into the pre-built libraries? If I build SDL2.dll myself using the Visual C++ solution (VS2015 Community Update 3) then the call succeeds as I expect
2017-08-29 22:04:43 -07:00
Sam Lantinga
3c1d56a2eb Fixed bug 3719 - Cocoa - Incorrect window size when leaving fullscreen
bastien.bouclet

When exiting a "fullscreen space" on OS X, windows don't go to their defined "windowed mode size", but go back to their previous size.

Steps to reproduce:
1. Create a windowed mode SDL window
2. Toggle it to fullscreen with the SDL_WINDOW_FULLSCREEN_DESKTOP flag
3. While in fullscreen, change the windowed mode size using SDL_SetWindowSize
4. Toggle the window back to windowed mode

Expected result:
- The window has the size specified during step 3.

Actual result:
- The window has the size specified when creating the window in step 1.

Attached is a minimal reproduction test case.
The attached test case works as expected on X11 and Windows.
2017-08-29 21:42:22 -07:00
Ryan C. Gordon
8f60f0a775 test: forgot to change a variable.
Fixes Bugzilla #3787.

--HG--
extra : amend_source : c7474d259e202abcde7a917242859f79e5d7d766
2017-08-29 18:25:55 -04:00
Ryan C. Gordon
9b08483ffd test: Fix for negative int that was now a size_t (thanks, Ozkan!).
Fixes Bugzilla #3787.

--HG--
extra : amend_source : 8b47684fad05b69ea4410dfb67dcac382b310914
2017-08-29 18:16:38 -04:00
Ryan C. Gordon
c4eca8c2d6 egl: Cast to size_t, in case platform's NativeDisplayType isn't a pointer.
(fixes compiler warnings on QNX.)
2017-08-29 16:30:49 -04:00
Ryan C. Gordon
e088b11c8a A few more compiler warnings fixed. 2017-08-29 16:05:03 -04:00
Ryan C. Gordon
fca3874ab4 Fixed a bunch of compiler warnings.
--HG--
extra : rebase_source : a2c94cfaf300f4d9f5b7855489ed05c8e23de9fd
2017-08-29 15:52:49 -04:00
Sam Lantinga
03c8f2002b Updated documentation, you don't need to initialize the audio subsystem to do in-place format conversion. (Thanks Simon Hug!) 2017-08-29 09:02:04 -07:00
Sam Lantinga
51b14ba255 Fixed check for Mac OS X 10.11+ SDK (thanks Edward Rudd!) 2017-08-29 08:27:23 -07:00
Sam Lantinga
adfae6e9ba MAC_OS_X_VERSION_MAX_REQUIRED isn't actually set in recent Xcode versions 2017-08-29 02:32:53 -07:00
Sam Lantinga
a30aa1778d Removed Metal and QuartzCore frameworks which aren't needed for Vulkan support 2017-08-29 01:04:48 -07:00
Sam Lantinga
64283b7c0f Add a way to set the context when other activities are active so many SDL API functions still work. 2017-08-28 23:04:47 -07:00
Sam Lantinga
cbfddcec50 Fixed bug 3785 - fix windows build after revision 11382
Ozkan Sezer

fix windows build after revision 11382: commit 2c50e79b19e0 renamed
_SDL_msctf_h to SDL_msctf_h_ . SDL_windowskeyboard.c relies on that
macro, so update it accordingly.
2017-08-28 22:44:48 -07:00
Sam Lantinga
ac8d70a84e We removed QuartzCore link dependency in commit d459d8934897 2017-08-28 22:42:41 -07:00
Sam Lantinga
01bfc6aca9 Fixed Vulkan configure check for Android and added one for Mac OS X 2017-08-28 22:36:45 -07:00
Sam Lantinga
1c487929ed Fixed bug 3786 - building against a Mac OS X SDK < 10.11 fails since the vulkan merge
Ozkan Sezer

Since the Vulkan merge, building against a Mac OS X SDM older than
10.11 fails in SDL_cocoametalview.m because Metal.framework is not
present. There is no conditional compiling in SDL_cocoametalview.m
either, so --disable-video-vulkan doesn't help with anything. (The
configury doesn't check darwin for x86_64 either, but it's another
story.)

I cross-build against 10.8 SDK on linux using clang-3.4.2 and this
is a problem for me.  Will this be fixed?
2017-08-28 22:13:45 -07:00
Sam Lantinga
a86f7e738e Fixed bug 3662 - Error message when using the audio conversion setup without an initialized audio subsystem is a bit vague
Simon Hug

This issue actually raises the question if this API change (requirement of initialized audio subsystem) is breaking backwards compatibility. I don't see the documentation saying it is needed in 2.0.5.
2017-08-28 21:42:39 -07:00
Ryan C. Gordon
70aacb0db9 audio: A whole bunch of improvements to audio conversion (thanks, Solra!).
"Major changes, roughly in order of appearance:

- Use float math everywhere, instead of promoting to double and casting back
all the time.
- Conserve sound energy when downmixing any channel into two other channels.
- Add a QuadToStereo filter. (The previous technique of reusing StereoToMono
never worked, since it assumed an incorrect channel layout for 4.0.)
- Add a 71to51 filter. This removes just under half of the cases the previous
code would silently break in.
- Add a QuadTo51 filter. More silent breakage fixed.
- Add a 51to71 filter, removing another almost-half of the silently broken
cases.
- Add 8 to the list of values SDL_SupportedChannelCount will accept.
- Change SDL_BuildAudioCVT's channel-related logic to handle every case, and
to actually fail if it fails instead of silently corrupting sound data and/or
crashing down the road."

(Note that SDL doesn't otherwise support 7.1 audio yet, but hopefully it will
soon and the 7.1 converters are an important piece of that.  --ryan.)

Fixes Bugzilla #3727.

--HG--
extra : rebase_source : c61476a6434b4cfe1655f5d30332280cb4cd7af9
2017-08-29 00:41:45 -04:00
Ryan C. Gordon
a32e087d07 stdlib: An implementation of SDL_scalbn using ldexp() (thanks, Ozkan!).
Fixes Bugzilla #3767.

--HG--
extra : rebase_source : c8dfcbc036ca99ce20808a33204cd87ae9b3e4d2
2017-08-29 00:36:17 -04:00
Ryan C. Gordon
1641fd7c50 audio: Converting audio samples from int to float was using wrong equation.
Fixes Bugzilla #3775.

--HG--
extra : rebase_source : 960d1ec9d440bca3da46e50e8f14c3139eac756c
2017-08-29 00:02:04 -04:00
Sam Lantinga
8e5f46fa1d Fixed building with an older Mac OS X SDK 2017-08-28 20:52:05 -07:00
Sam Lantinga
ebe9688dd9 Vulkan support on Mac OS X introduces a link time dependency (CAMetalLayer) on 10.11 and newer 2017-08-28 19:32:08 -07:00
Sam Lantinga
a59b14cfcb We don't need the VULKAN_SDK to build SDL with Vulkan support anymore 2017-08-28 19:30:59 -07:00
Sam Lantinga
d2d5ffbe3e Added missing Visual Studio 2010 project for testvulkan 2017-08-28 17:28:09 -07:00
Sam Lantinga
21140a8024 Fixed compile warning 2017-08-28 14:45:19 -07:00
Sam Lantinga
756155d9b9 Added a log message for nativeRunMain() 2017-08-28 14:44:21 -07:00
Sam Lantinga
32a6dbb2ac Allow overriding the main entry point on Android 2017-08-28 14:40:21 -07:00
Sam Lantinga
b223cd8606 Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations 2017-08-28 14:34:15 -07:00
Sam Lantinga
297011fe09 Removed unneeded Vulkan symbol definitions 2017-08-28 13:40:32 -07:00
Sam Lantinga
09b61ab1fd Fixed bug 2361 - [Android] Joysticks do not have unique IDs
David Brady

When I attempted to make a mapping file for Android gamepads, I quickly discovered that most of the ones that I have here show up as the same device (Broadcom Bluetooth HID), meaning that it was impossible to make mappings on Android, since every device looked the same.

This patch will check for the existence of the getDescriptor function added in Jelly Bean, and use it if it's there.  The Android Dashboard says that the majority of Android phones should support this function, and doing it this way will not force us to bump up our API version.
2017-08-28 10:03:39 -07:00
Sam Lantinga
d1c0e570c8 Fixed bug 2277 - Hardware keyboard control key sequences don't get reported
chw

Control key sequences from hardware keyboards (wireless/USB/bluetooth) get not properly reported on Android devices.
The attached patch uses the idea from http://stackoverflow.com/questions/12337117/capture-all-ctrl-under-android to make control key sequences appear as normal SDL_KEYDOWN events instead of cooked text input.
2017-08-28 09:54:16 -07:00