Commit graph

11411 commits

Author SHA1 Message Date
Sylvain Becker
0d0b51f2db Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect 2019-08-24 20:40:37 +02:00
Ozkan Sezer
0df1fc13af fix permissions 2019-08-23 03:01:10 +03:00
Sam Lantinga
b9acc8cecd Fixed whitespace 2019-08-22 16:12:16 -07:00
Sam Lantinga
f9c83e5ce5 [SDL][IOS] Audio fix - applies stream to sound data when resampling or reformatting is required. 2019-08-22 16:09:42 -07:00
Sam Lantinga
524454bad0 Prevent the SPEEDLINK COMPETITION PRO joystick from switching into Android controller mode when enumerated over HID on Windows 10. 2019-08-22 15:58:00 -07:00
Alex Szpakowski
504d68fa8f macOS: Use the proper type (NSSize instead of CGSize) for the bounds of metal views. 2019-08-22 19:23:52 -03:00
Sylvain Becker
0fb1a8c50a Fixed bug 4172 - remove logging Gesture error "NumPoints = 0"
- not necessary when app isn't recording gesture.
- happen when gesture path has less than 2 different points
2019-08-22 10:15:33 +02:00
Sylvain Becker
39b5b2d72c Fix audio conversion U16_to_F32_SSE2 (bug 4186) 2019-08-19 21:23:47 +02:00
Sylvain Becker
8749ba20aa Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
reverse the order when storing ouput buffer
2019-08-19 20:35:02 +02:00
Sylvain Becker
940eeb03d0 Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
reverse the order when storing ouput buffer
2019-08-19 16:57:15 +02:00
Alex Szpakowski
0f14f2a87a metal renderer: optimize SDL_RenderFillRect slightly. 2019-08-18 10:38:32 -03:00
Alex Szpakowski
ccfe75a655 render: fix colors not being set properly after the previous change 2019-08-18 09:35:11 -03:00
Alex Szpakowski
0b01e3cf35 render: avoid a couple redundant memcmp calls in all drawing functions. Improves performance slightly. 2019-08-17 22:26:33 -03:00
Alex Szpakowski
fd9b2e7257 metal renderer: use vertex attributes instead of indexing into a buffer with the vertex id in the shader. Allows for more flexibility with vertex setup in the future.
Also optimize vertex buffer binding slightly.
2019-08-17 16:53:08 -03:00
Alex Szpakowski
bee3a60005 metal renderer: more closely match buffer data alignment requirements from the metal specification. 2019-08-17 01:09:30 -03:00
Alex Szpakowski
e03c7d97d3 render: simplify vertex and uniform data allocation. Improves performance of various SDL_Render functions (bug #4764). 2019-08-17 00:43:44 -03:00
Alex Szpakowski
8a2ccace8a metal renderer: use the device address space instead of the constant address space for colors.
It doesn't negatively impact GPU performance in my tests, and it removes the need for 256 byte memory alignment of color data on macOS.
2019-08-17 00:37:22 -03:00
Alex Szpakowski
9d1d406b74 metal: Update compiled shaders based on compilation script changes 2019-08-16 22:13:30 -03:00
Alex Szpakowski
c4524f16b7 metal: Update shader compilation script with fixes for newer xcode versions and for running on older platforms 2019-08-16 22:11:50 -03:00
Alex Szpakowski
1cac684966 iOS: Fix issues with Split VIew on iPad (bugs #4586, #4705). 2019-08-15 19:38:12 -03:00
Sylvain Becker
7a36cc410d Android: remove tabs/indent 2019-08-15 20:38:25 +02:00
Sylvain Becker
d6637510b2 Android: SDL_image/SDL_mixer/SDL_ttf partially compiling with CMake (bug 3918) 2019-08-13 16:00:08 +02:00
Sam Lantinga
dcf21d5da2 Disable HIDAPI by default, as it breaks on Linux when trying to use libusb with non-root permissions on some distributions 2019-08-12 13:35:36 -07:00
Sylvain Becker
79da113ed7 Fixed bug 3918 - CMake support for android project 2019-08-11 15:23:37 +02:00
Ozkan Sezer
102850e1bd fix permissions 2019-08-08 23:35:02 +03:00
Sam Lantinga
9a01434255 [ SDL ] Fix compile error building for Windows/ARM64 on Visual Studio 2017 Win10 SDK 10.0.18362.0 which requires ar,74intr.h/arm64_neon.h header instead of armintr.h/arm_neon.h for intrinsics.
@saml
2019-08-08 13:26:05 -07:00
Ethan Lee
ebf1ac3122 hidapi: Explicitly include locale.h, for setlocale 2019-08-06 23:08:01 -04:00
Sam Lantinga
5a7015c93c Fixed bug 4747 - [Patch] SDL_ShowMessageBox ignores BUTTON_RETURNKEY_DEFAULT flag
Caleb Cornett

SDL_ShowMessageBox on UIKit doesn't do anything special with buttons that are marked with the flag SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT. According to Apple's documentation on UIAlertController, a button can respond to a return key if it's marked as the preferredAction of the controller. SDL doesn't set a preferredAction currently, so I've attached a patch to fix that.
2019-08-05 23:52:16 -07:00
Sam Lantinga
97b93a86d6 Fixed bug 4354 - CMake builds do not correctly enable IME on Linux
Callum McGing

While the CMake build checks for ibus and does enable the ibus backend with set(HAVE_IBUS_IBUS_H TRUE), this does not define SDL_USE_IME, thus CMake built SDL2 (as in Arch Linux) cannot use IME at all.

The attached patch fixes this behaviour when building against ibus. IME support will still fail when only fcitx is available on the build system.
2019-08-05 23:46:09 -07:00
Sam Lantinga
01075dc1f2 Fixed bug 4689 - SDL fails to detect compositor shutdown on Wayland -- program keeps running
M Stoeckl

To reproduce:

1. Run any SDL-based program with a Wayland compositor, orphaning it so that it doesn't have an immediate parent process. (For example, from a terminal, running `supertux2 & disown`.) The program should use the wayland backend, i.e. by setting environment variable SDL_VIDEODRIVER=wayland.
2. Kill the compositor process.

Results:

- The SDL program will keep running.

Expected results:

- The SDL program should close. (What close should mean here, I'm not sure - is injecting an SDL_Quit the appropriate action when a video driver disconnects?)

Build data:

2019-06-22, hg tip (12901:5cbf6472a916), Linux, can reproduce with sway, weston, and other Wayland oompositors.
2019-08-05 23:38:48 -07:00
Ethan Lee
99abe1244f Port libusb hid.c to SDL, add to MinGW configure 2019-08-04 00:01:38 -04:00
Alex Szpakowski
0ba98cae5f Add public APIs for creating a Metal view attached to an SDL window. Add SDL_metal.h. 2019-08-05 12:35:32 -03:00
Alex Szpakowski
84cb66b8a8 macOS: fix a typo in touch handling code. 2019-08-04 23:30:55 -03:00
Alex Szpakowski
5934a368bb Fix touch-related compile errors on Linux. 2019-08-04 16:56:40 -03:00
Ozkan Sezer
2467ed197c minor warning fixes. 2019-08-04 14:56:02 +03:00
Alex Szpakowski
99c222cc77 Implement touch window IDs on x11/xinput2. 2019-08-04 00:34:23 -03:00
Ozkan Sezer
08a0f96749 fix permissions 2019-08-03 12:50:28 +03:00
Ozkan Sezer
0f3d9a7186 remove test/aclocal.m4 2019-08-03 12:49:50 +03:00
Sam Lantinga
1d2350c07f Fixed building on Mac OS X without libusb 2019-08-02 18:14:31 -07:00
Sam Lantinga
7de41a80e1 Fix nullptr crash on android
nullcheck the device coming back from InputDevice.getDevice(deviceId) in new code added to sdlactivity.onkey.


java.lang.NullPointerException:
  at org.libsdl.app.SDLSurface.onKey (SDLActivity.java:1793)
  at android.view.View.dispatchKeyEvent (View.java:13321)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:685)
  at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1869)
  at android.app.Activity.dispatchKeyEvent (Activity.java:3447)
  at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java:496)

@dang @saml @dave
2019-08-02 17:20:00 -07:00
Sam Lantinga
ac6485552e Fix bug where the wrong button was the default in the old message box because buttons were added backwards, breaking the indexing used by GetButtonIndex.
Add messagebox flags to explicilty request left-to-right button order or right-to-left.  If neither is specified it'll be some platform default.
2019-08-02 17:19:50 -07:00
Sam Lantinga
f146a96b35 Added support for a few controllers on Android 2019-08-02 17:12:49 -07:00
Alex Szpakowski
d34695ffd4 Add a windowID field to SDL_TouchFingerEvent (bug #4331).
This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
2019-08-01 18:22:12 -03:00
Ozkan Sezer
c8e23236cd configury: allow libusb-less hidapi for macosx. 2019-08-01 17:41:40 +03:00
Ozkan Sezer
9c13eeabbb use WIN_IsWindowsVistaOrGreater() from core/windows for isVistaOrNewer 2019-07-31 23:37:02 +03:00
Ethan Lee
55c49e7d33 hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.

Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.
2019-07-31 12:20:55 -04:00
Sam Lantinga
571fc2a8b1 Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent() 2019-07-31 10:20:37 -07:00
Andrew Eikum
e0039a7c75 joystick: Ensure HIDAPI is initialized before calling it 2019-07-31 11:14:48 -05:00
Andrew Eikum
5e44950dfe cmake: Fix locating libusb header at configure-time
Removing the CheckUSBHID call is necessary to avoid caching the failed header
check result before we find libusb via pkg-config.
2019-07-31 11:34:00 -05:00
Ozkan Sezer
ac7da51929 minor whitespace tidy-up. 2019-07-31 19:40:50 +03:00