Commit graph

11259 commits

Author SHA1 Message Date
Ryan C. Gordon
b642a170c7 cocoa: ignore compiler warnings about OpenGL being deprecated.
--HG--
extra : rebase_source : 03fdc2f8505ae6d664d46f82a58423b4170e256c
2019-06-14 21:18:53 -04:00
Ryan C. Gordon
9935079f99 A few minor changes to placate static analysis.
--HG--
extra : rebase_source : ef8116836b0d9d8e9f6e919221968d8c0d5844a6
2019-06-14 18:23:51 -04:00
Sam Lantinga
4fbcde6f13 Added support for Xbox and PS4 wireless controllers on iOS and tvOS
Also implemented SDL_JoystickGetDevicePlayerIndex() on iOS and tvOS, and added support for reading the new menu button state available in iOS and tvOS 13.
2019-06-14 13:56:52 -07:00
Sam Lantinga
1e112238be Worked around "Undefined symbol: ___isPlatformVersionAtLeast()" link error on Xcode 11 beta 2019-06-14 13:56:42 -07:00
Ryan C. Gordon
542a139882 audio: Attempt to fix build on ARM versions of Visual Studio. 2019-06-14 16:52:42 -04:00
Ryan C. Gordon
fce6b0efba audio: Fix ARM NEON audio converter bugs.
(Patch from Sylvain, I'm just applying it.)

Fixes Bugzilla #4186.
2019-06-14 15:52:48 -04:00
Ryan C. Gordon
c6bda24fa6 audio: patched to compile. 2019-06-14 15:47:32 -04:00
Ethan Lee
97b9dbbf09 Check src alignment for S32_to_F32 conversions 2019-06-14 09:51:22 -04:00
Ryan C. Gordon
fe2bef018f cocoa: Another attempt at synthesized mouse/touch events. 2019-06-13 21:31:03 -04:00
Ryan C. Gordon
5949bfe3ca cocoa: Revised synthesized mouse/touch event strategy.
I _think_ I understand what Sylvain is working on here now, so hopefully I
got this right.

Fixes Bugzilla #4576.

(I think!)
2019-06-13 01:57:13 -04:00
Alex Szpakowski
5e15950a40 macOS: Fix the coordinate space of SDL_GetDisplayUsableBounds (thanks Tim!)
Fixes bug #4518.
2019-06-12 19:57:30 -03:00
Alex Szpakowski
7a2672555d iOS: Remove didAddSubview override in NSWindow, its code breaks things which rely on focus changing within SDL's UIWindow (bug #4659). 2019-06-12 19:15:56 -03:00
Ryan C. Gordon
c168d7e714 wave: Fixed static analysis warning about dead assignment.
(technically, this function never returns an error at this point, but since
it _does_ have an "uhoh, is this corrupt data?" comment that it ignores, we
should probably make sure we handle error cases in the future.  :)  )
2019-06-12 15:43:08 -04:00
Ryan C. Gordon
40ba80fec2 vulkan: Fixed use-after-free bug. 2019-06-12 15:37:07 -04:00
Ryan C. Gordon
e6f2a420e7 assert: Fixed some compiler warnings. 2019-06-12 15:35:06 -04:00
Sam Lantinga
3837a1233c Better patch to make it more clear what's going on 2019-06-12 10:38:49 -07:00
Sam Lantinga
7bb3e6b87c The hat index passed to the application should be zero-based with no holes 2019-06-12 10:35:47 -07:00
Sam Lantinga
300437765f Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux)
Matteo Beniamino

Pressing a trigger button on a Steam Controller causes a segmentation fault both with stable version and latest mercurial head on Linux. I'm using the recent hid_steam kernel module with lizard_mode disabled (that is no keyboard/mouse emulation). I suspect this is what's happening: the driver exposes two hats. The two hats have indices 0 and 2. Inside linux/SDL_sysjoystick.c two hats are allocated in allocate_hatdata for joystick->hwdata->hats. In HandleHat function the hat parameter (that can be 2) is directly used as the index of the array that only has two elements, causing an out of bounds access. SDL is not expecting to have "holes" between hats indices.

The index 2 is calculated in HandleInputEvents() as (ABS_HAT2X - ABS_HAT0X) / 2 where ABS_HAT2X is the value associated to the hat inside the hid_steam module.
2019-06-12 10:32:36 -07:00
Sam Lantinga
d197c26349 Fixed bug 4665 - Add support for single touch evdev devices
Jan Martin Mikkelsen

The attached patch adds support for single-touch evdev devices.

These devices report ABS_X, ABS_Y and BTN_TOUCH events. This patch sets them up as MT devices with a single slot and handles the appropriate messages.
2019-06-12 07:55:48 -07:00
Sebastian Krzyszkowiak
173c6882cd wayland: HiDPI support 2019-06-12 00:55:05 +02:00
Ozkan Sezer
dcd3dc4c03 fix permissions 2019-06-12 13:56:20 +03:00
Sylvain Becker
9be0b70ee9 SDL_Wave: missing field 'length' initializer 2019-06-12 10:42:02 +02:00
Ryan C. Gordon
dc9780679d assert: mark SDL_ExitProcess as SDL_NORETURN again.
Put in a hack to (hopefully) make MingW happy.

Fixes Bugzilla #4100.

--HG--
extra : rebase_source : c40bcd9feb71b38c277d690e611d211b9f629a2b
2019-06-11 21:57:30 -04:00
Ryan C. Gordon
064b2d9818 cocoa: Backed out CVDisplayLink code for macOS vsync.
This was to deal with broken vsync support in macOS 10.14, which we assumed
would remain broken indefinitely, but a later 10.14 released fixed it.

This is a loss of late-swap support, but there are several subtle problems
in our CVDiplayLink code that are also evaporating, to be fair.

Fixes Bugzilla #4575.

(Backed out changeset 73f3ca85ac0e)

--HG--
extra : rebase_source : 0904a47668287aa612a5a5cb21e720d460b730f3
2019-06-11 16:19:01 -04:00
Sam Lantinga
13647c8935 Fixed bug 4615 - RPM Build fails due to unpackaged files
devbeer

The current SDL2.spec fails to build with:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/build/rpmbuild/BUILDROOT/SDL2-2.0.9-2.x86_64
error: Installed (but unpackaged) file(s) found:
   /usr/lib64/cmake/SDL2/sdl2-config.cmake


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib64/cmake/SDL2/sdl2-config.cmake
2019-06-11 19:58:10 -07:00
Sam Lantinga
7982263c9c Fixed bug 4570 - Support Vulkan Portability rather than MoltenVK specifically
Dzmitry Malyshau

Current code, search paths, and error messages are written to only consider MoltenVK on macOS as a Vulkan Portability implementation. It's not the only implementation available to the users. gfx-portability [1] has been shown to run a number of titles well, including Dota2, Dolphin Emulator, and vkQuake3, often out-performing MoltenVK in frame rate and stability (see Dolphin benchmark [2]).

There is no reason for SDL to be that specific, it's not using any MVK-specific functions other than the WSI initialization ("VK_MVK_macos_surface"). gfx-portability exposes this extension as well, and a more generic WSI extension is in process. It would be good if SDL was written in a more generic way that expect a Vulkan Portability library as opposed to MoltenVK specifically.

[1] https://github.com/gfx-rs/portability
[2] https://gfx-rs.github.io/2019/03/22/dolphin-macos-performance.html
2019-06-11 18:13:46 -07:00
Ryan C. Gordon
37dd347b8b software: Fixed compiler warning and dos2unix'd the endlines. 2019-06-11 15:06:35 -04:00
Ryan C. Gordon
b432350fc9 software: Correctly track viewport and cliprect.
Fixes Bugzilla #4457.
2019-06-11 14:09:53 -04:00
Ryan C. Gordon
1bfe8fadc9 direct3d: Use D3DPOOL_MANAGED for vertex buffers.
Fixes Bugzilla #4537.
2019-06-11 13:02:56 -04:00
Sam Lantinga
5eff051a09 Fix build with the 10.10 SDK 2019-06-11 08:33:30 -07:00
Ryan C. Gordon
39f5a59c7e direct3d: Fixed SDL_RenderSetClipRect usage.
Fixes Bugzilla #4459.
2019-06-11 10:12:47 -04:00
Ryan C. Gordon
ad14c4654c direct3d: don't dereference bogus pointer if current texture was destroyed.
Fixes Bugzilla #4460.
2019-06-11 09:29:48 -04:00
Sylvain Becker
fcb3684025 Android: fix coordinates for Surface.ROTATION_180
https://discourse.libsdl.org/t/android-screen-orientation-issues-2-0-9/26262
2019-06-11 11:01:15 +02:00
Sylvain Becker
3a4db15e17 Android: revert wrong fix typo calling onBackPressed() (Bug 4657) 2019-06-11 10:19:26 +02:00
Ryan C. Gordon
c827b5db23 testoverlay2: Changed some C runtime calls to be SDL equivalents. 2019-06-11 02:32:43 -04:00
Ryan C. Gordon
6480984e0a direct3d: Fixed more compiler warnings on Visual Studio 64-bit builds. 2019-06-11 02:31:57 -04:00
Ryan C. Gordon
c753f01b69 video: fixed compiler warning on Visual Studio. 2019-06-11 02:14:59 -04:00
Ryan C. Gordon
76209ea774 windows: Don't let Visual Studio insert an implicit dependency on memset().
Fixes Bugzilla #4662.
2019-06-11 02:08:31 -04:00
Ryan C. Gordon
1fe85c6de8 windows: Drop WM_ACTIVATE when window is hidden, but only if being activated.
Fixes Bugzilla #4571.

--HG--
extra : amend_source : 89c8a4221e3f10b5c873c0a14cc6dc7ca11be20a
2019-06-11 01:14:24 -04:00
Sylvain Becker
fa9722ea01 Android: add MinimizeWindow function (Bug 4580, 4657)
shouldMinimizeOnFocusLoss is un-activated (return false)
2019-06-10 21:58:03 +02:00
Sylvain Becker
608dc4f6ce Android: fix typo calling onBackPressed() (Bug 4657) 2019-06-10 21:41:22 +02:00
Benjamin Valentin
27c86d94f6 Add mapping for Chinese-made Xbox Controller
This device is a copy of the Xbox Controller S and currently the one most sold
when shopping for a 'new' Xbox gamepad on eBay and AliExpress.
Except for the quirky USB ID id behaves just like a normal Xbox controller (when
ignoring the subpar build quality)
2019-03-17 23:47:12 +01:00
Sam Lantinga
8f0fea0f08 Fixed bug 4662 - SDL failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode with MSVC on Windows
LinGao

We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode on latest default branch. And we found that it can be first reproduced on a39d8cdf50f4 changeset. Could you please help have a look about this issue? Thanks in advance!
2019-06-10 08:49:26 -07:00
Sam Lantinga
b689dae897 Fixed bug 4641 - clang and clang-cl builds on windows create -Wpragma-pack warnings 2019-06-10 08:46:20 -07:00
Ryan C. Gordon
4cd26373d6 cocoa: report proper input IDs for mouse/touch events.
Otherwise, we generate incorrect mouse events for MacBook trackpads (which
are also multitouch devices), etc.

Partially fixes Bugzilla #4576.

--HG--
extra : rebase_source : 03dee8e7eca900c7995a90d0507c1a2325df55c4
2019-06-09 19:27:25 -04:00
Sam Lantinga
6c473135a3 Fixed bug 4658 - iOS 12 fullscreen flag and SDL_HINT_IOS_HIDE_HOME_INDICATOR not working
Caleb Cornett

On iOS 12, creating a window with the SDL_WINDOW_FULLSCREEN flag does not dim the home indicator or defer system gestures. The same goes for setting the SDL_HINT_IOS_HIDE_HOME_INDICATOR to "2" -- it has no effect at all.

I've tracked down the source of this misbehavior to a timing issue. The initial `setNeedsUpdate...` calls were happening too early and getting applied to the launch screen by mistake. In the attached patch, I've added a call to those functions right after the launch screen is hidden so that they apply to the main view controller instead. This appears to fix the issue, at least on my iPhone 6s Plus.
2019-06-09 14:08:18 -07:00
Ethan Lee
d7ef1c6933 Add notes for SDL_WinRTRunApp and SDL2-WinRTResources for non-C++ projects 2019-06-09 11:54:51 -04:00
Sam Lantinga
03746a249a Cleanup on bug 3894 - Fuzzing crashes for SDL_LoadWAV
Simon Hug

Attached is a minor cleanup patch. It changes the option name of one hint to something better, puts one or two more checks in, and adds explicit casting where warnings could appear otherwise.

I hope the naming of the hints and their options is acceptable. It would be kind of awkward to change them after they get released with an official SDL version.
2019-06-09 12:46:10 -07:00
Sam Lantinga
3eee84f9c3 Fixed compiler warning
warning C4018: '<' : signed/unsigned mismatch
2019-06-08 19:12:05 -07:00
Sam Lantinga
8981c38815 Fixed build 2019-06-08 19:09:43 -07:00