Commit Graph

61 Commits (717f2978493f1a50e9a4abd4731e8ddda7c04b90)

Author SHA1 Message Date
Ryan C. Gordon 2613e3da24 camera: Rewrote Android support.
This does something a little weird, in that it doesn't care what
`__ANDROID_API__` is set to, but will attempt to dlopen the system
libraries, like we do for many other platform-specific pieces of SDL.

This allows us to a) not bump the minimum required Android version, which is
extremely ancient but otherwise still working, doing the right thing on old
and new hardware in the field, and b) not require the app to link against
more libraries than it previously did before the feature was available.

The downside is that it's a little messy, but it's okay for now, I think.
2024-02-20 15:56:26 -05:00
Ryan C. Gordon f3485a47b3 android: Add src/main/ files to Android.mk 2024-02-20 15:56:26 -05:00
Anonymous Maarten 25ce87979d Always provide an implementation for all SDL3 symbols 2023-10-12 14:00:47 +02:00
Sam Lantinga 5a62a4596e Fixed building with the 16.1.4479499 Android toolchain
(cherry picked from commit b9d1c483b90e2a1c23053692e06d15f9dbd5fe99)
2023-06-13 07:50:00 -07:00
Sam Lantinga 6dc135413a Create a static SDL_test library on Android 2023-01-25 13:06:42 -08:00
Sam Lantinga 39852241ef Added -Wdocumentation to CMake clang build 2023-01-03 15:58:48 -08:00
Daniel Gibson c3bf253b09 Remove SDL3_main from build systems, remove most of src/main/*
XCode is still missing, and src/main/winrt/SDL3-WinRTResource*
still need to find a new home
2022-12-15 08:01:01 -08:00
Jan Engelhardt 1878674477 build: add symbol versioning for SDL
If a program built against one version of SDL is run in an
environment where there is an earlier version of the SDL .so library
installed, the result varies depending on platform configuration; in
the best case, it won't start at all, at worst it aborts in the
middle of the user doing "something important" (systems implementing
lazy symbol resolution). verdefs on the other hand are always checked
on startup.

The dependency information present in programs and shared libraries
is not only of value to the dynamic linker, but also to a
distribution's package management. If the dynamic linker is able to
tell that a program is not runnable per the above, a package manager
is able to come to the same conclusion — and block the installation
of a nonfunctional program+library ensemble.

Because there are a lot more symbols than there are libraries (I am
going to throw in "10^4 to 1 or worse"), package managers generally
do not evaluate symbols, but only e.g. the SONAME, NEEDED and VERNEED
fields/blocks. Because the SONAME is the same between two SDL
versions like 2.0.24, and 2.0.26, everything rests on having verdefs.

This patch proposes the addition of verdefs.
2022-12-02 13:05:37 -08:00
Sam Lantinga c5790359fd
Added precompiled header support for Visual Studio and Xcode (#6710)
Fixes https://github.com/libsdl-org/SDL/issues/6704
2022-11-29 18:34:15 -08:00
Sam Lantinga c2432f8d0d Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries 2022-11-28 10:57:59 -08:00
Anonymous Maarten 47c37a8e9d android.mk: LOCAL_EXPORT_C_INCLUDES does not need to add include subfolder 2022-11-22 18:35:49 +01:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 8ae46a49ea Save the version in VERSION.txt instead of VERSION
Fixes https://github.com/libsdl-org/SDL/issues/6558
2022-11-21 06:57:02 -08:00
Ozkan Sezer c29629a5ef fix permissions of Android.mk 2022-10-01 04:25:40 +03:00
Sam Lantinga 28572702bf Properly backspace over text that was entered when autocorrect updates text with the iPhone on-screen keyboard 2022-09-30 17:25:57 -07:00
Ozkan Sezer 7567c4cb00 revert executable permissions from Android.mk 2022-09-30 21:51:11 +03:00
Sam Lantinga 82e341bc9e Android: use real editable text and mimic the edit operations to generate key events
This fixes issues where the IME and the output would get out of sync
2022-09-30 11:40:29 -07:00
Anonymous Maarten d76f0cc753 Android.mk: Build android SDL2.so with `-Wl,--no-undefined` 2022-09-27 13:13:52 -07:00
Ozkan Sezer c3a4a6a033 mark Android.mk as non-executable 2021-11-12 12:55:28 +03:00
Sam Lantinga 97c71371f2 If Android version >= API 31 PendingIntent.FLAG_MUTABLE
"If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security."

Thanks @FormularSumo and @cgutman
2021-11-12 01:21:29 -08:00
Ozkan Sezer 33735d5997 mark Android.mk as non-executable 2021-11-12 07:40:00 +03:00
Sam Lantinga ed05a0e9e7 Fixed exception trying to get USB permission
You can't set the intent to be immutable, otherwise the USB system can't set the device and permission in the response. This works fine on Android 12 without an immutable intent.
2021-11-11 20:33:02 -08:00
Sam Lantinga 5b646cd19e Build hidapi code into SDL as a new public API
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
2021-11-07 23:00:59 -08:00
Ozkan Sezer 646ddfb782 minor watcom build fixes. 2021-05-15 00:22:50 +03:00
Sam Lantinga 9231f1f1cf Added support for the PS5 controller on iOS and tvOS 2021-05-07 12:29:03 -07:00
Sylvain 146656cfe6
AAudio: add compilation to Android.mk, but not activated in SDL_config_android.h 2021-04-15 21:03:10 +02:00
Ozkan Sezer e58cc5fa0e minor whitespace fix 2020-10-09 03:28:30 +03:00
Sam Lantinga 79e625f017 Fixed trying to build OSX SDL_OpenURL on iOS and tvOS 2020-10-08 17:01:28 -07:00
Ryan C. Gordon 77c9d73b63 Removed SDL_AndroidOpenURL, added SDL_OpenURL.
Still needs to be wired into Xcode and Visual Studio projects.
2020-10-05 11:30:33 -04:00
Ozkan Sezer 9db16a6557 fix permissions of some project files 2020-06-14 12:21:02 +03:00
Ryan C. Gordon fa23e3d00b locale: Implemented SDL_GetPreferredLocales().
This was something I proposed a long time ago, Sylvain Becker did
additional work on it, then back to me.

Fixes Bugzilla #2131.
2020-05-04 02:27:29 -04:00
Sam Lantinga 9e3b259dec Added virtual joystick sources to the Android build 2020-04-13 19:17:28 -07:00
Sam Lantinga c7a62b410b There are lots of unused macros in the Steam controller code 2020-01-29 20:09:12 -08:00
Ozkan Sezer 51df932efb fix permissions 2019-09-05 13:21:02 +03:00
Sam Lantinga e5580e18ba x11: add a hint to force the VisualID used when creating a window. 2019-09-04 09:27:58 -07:00
Sylvain Becker 6794ec6670 Android: add more warning flags 2019-08-30 08:43:13 +02:00
Ozkan Sezer 09142eb715 fix permissions 2019-06-12 13:56:20 +03:00
Sam Lantinga 7dc92a7669 Initial Android OpenSL ES implementation, contributed by ANTA 2019-01-12 12:18:44 -08:00
Sam Lantinga db320e460a Fixed the PS4 motion controls showing up as a separate game controller on Linux 2018-12-04 14:21:29 -08:00
Ryan C. Gordon 3323b355c9 android: use cpufeatures to support SDL_HasNEON() (thanks, Sylvain!).
Fixes Bugzilla #4406.
2018-12-01 12:19:11 -05:00
Ozkan Sezer 14e389eadc minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Sam Lantinga 2e348c1f59 Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick
maxxus

The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events.  Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
2018-11-14 13:37:22 -08:00
Sam Lantinga 47fb450beb Fixed bug 4315 - little Warning in Android_JNI_CaptureAudioBuffer
Sylvain

SDL_android.c
src/core/android/SDL_android.c:1302:5: warning: variable 'br' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
    default:
    ^~~~~~~
src/core/android/SDL_android.c:1306:12: note: uninitialized use occurs here
    return br;
           ^~
src/core/android/SDL_android.c:1270:12: note: initialize the variable 'br' to silence this warning
    jint br;
           ^


Maybe we could add some basics warning flags, not to see all warnings, but so that new warnings are caught sooner.

I would go for -Wall -Wextra, and some -Wno-warning for the allowed warnings.
2018-11-02 17:18:03 -07:00
Sam Lantinga df89abb23e Fixed bug 4335 - Android NDK build error
dmuratshin

LOCAL_SRC_FILES shouldn't use $(LOCAL_PATH)
2018-10-28 14:17:21 -07:00
Ozkan Sezer faf8f8b86b fix permissions 2018-08-30 12:50:10 +03:00
Sam Lantinga f1bc1c1274 Fixed crash trying to open HIDAPI controller as a haptics device on Windows 2018-08-22 17:44:28 -07:00
Sam Lantinga 7c3040e08a First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Ozkan Sezer f159d798dd chmod -x Android.mk 2018-08-10 11:50:01 +03:00
Sam Lantinga d2042e1ed4 Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Sam Lantinga ff8c9538bc Allow trapping the back button so right mouse click can work on some Android systems (thanks Rachel!)
Also, added a function SDL_AndroidBackButton() so applications can respond to the back button directly
2018-07-12 13:28:13 -07:00