Commit graph

47 commits

Author SHA1 Message Date
Sam Lantinga
1e33532e50 There are lots of unused macros in the Steam controller code 2020-01-29 20:09:12 -08:00
Ozkan Sezer
ed7faa076e fix permissions 2019-09-05 13:21:02 +03:00
Sam Lantinga
cc181908f0 x11: add a hint to force the VisualID used when creating a window. 2019-09-04 09:27:58 -07:00
Sylvain Becker
ed4d83da73 Android: add more warning flags 2019-08-30 08:43:13 +02:00
Ozkan Sezer
dcd3dc4c03 fix permissions 2019-06-12 13:56:20 +03:00
Sam Lantinga
57c735236b Initial Android OpenSL ES implementation, contributed by ANTA 2019-01-12 12:18:44 -08:00
Sam Lantinga
4011395e4a 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
063f4fb0ee android: use cpufeatures to support SDL_HasNEON() (thanks, Sylvain!).
Fixes Bugzilla #4406.
2018-12-01 12:19:11 -05:00
Ozkan Sezer
eb37476b4d minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Sam Lantinga
2005ea6ca2 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
176a57bcc3 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
1ce6f5502a 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
5bafa801d0 fix permissions 2018-08-30 12:50:10 +03:00
Sam Lantinga
e1853645b8 Fixed crash trying to open HIDAPI controller as a haptics device on Windows 2018-08-22 17:44:28 -07:00
Sam Lantinga
09c276f295 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Ozkan Sezer
e412b58e6b chmod -x Android.mk 2018-08-10 11:50:01 +03:00
Sam Lantinga
db39b4811f 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
bbc117137c 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
Ryan C. Gordon
9ddbda088a android: Android.mk should only preserve debug symbols in debug builds.
Fixes Bugzilla #4111.
2018-06-24 15:21:01 -04:00
Ozkan Sezer
53e38a8dfc ran 'chmod -x' on many files 2018-06-12 14:00:15 +03:00
Sam Lantinga
047df473a4 Added Android build script for SDL 2017-12-16 10:40:41 -08:00
Sam Lantinga
145d2469ae Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga
c2e69a5256 Removed non-existent files 2017-09-22 08:31:02 -07:00
Sam Lantinga
1e46b7fc9a Added stubs for simple Steam Controller support 2017-09-22 08:30:52 -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
6cfc67f5ef Fixed bug 2839 - No way to create pre-built libraries for Android
Mark Callow

README-android says to copy or link the SDL source tree to the jni folder in your Android project. It is not desirable to have to compile SDL with every application; furthermore the Android NDK has support for prebuilt libraries.

Attached is script (to be put in build-scripts) that builds the Android version of the libraries. The script builds both the existing SDL2 module and a new SDL2_main module. This is a static library containing the code from src/main/android/SDL_android_main.c. Also attached is a patch for Android.mk adding this module.

Note that when building an application's native .so using this prebuilt libSDL2main, you must use a link option, such as --whole-archive, that forces inclusion of the code in the .so because the functions in SDL_android_main are called only from Java.
2017-08-13 17:59:59 -07:00
Sam Lantinga
976866d13d Fixed bug 3191 - haptic system on android?
Patch provided by jintiao and Milan Nikolic, thanks!
2017-08-12 08:15:09 -07:00
Sam Lantinga
121cd476bc Make sure the memory barrier functions are always available, and now they are implemented on Android __ARM_ARCH_5TE__ 2017-02-10 11:21:15 -08:00
Philipp Wiesemann
8143b8c00b Android: Replaced spaces with tab in Android.mk file. 2015-05-06 21:11:06 +02:00
Sam Lantinga
c1d6f15368 Implemented SDL_GetPrefPath() on Android - it returns the path used by SDL_AndroidGetInternalStoragePath() 2014-08-11 17:25:53 -07:00
Sam Lantinga
a82d156de7 Fixed Android error on static lib build, if relative NDK_MODULE_PATH used
Stefan Pöschel

if the variable NDK_MODULE_PATH is set to a relative path (like "../"),
compiling of a static SDL lib fails with an error similar to this:
make: *** No rule to make target
`..//android_libs/SDL/..//android_libs/SDL/src/main/android/SDL_android_main.c',
needed by
`obj/local/armeabi/objs/SDL2_static/__//android_libs/SDL/src/main/android/SDL_android_main.o'.
 Stop.

Regarding the shared lib, this is already prevented by a "subst" command
in the /Android.mk, which removes all occurences of "$(LOCAL_PATH)/".
The attached patch does the same with the additional
"SDL_android_main.c", which is included for build the static SDL lib.
2014-06-15 13:01:10 -07:00
Ryan C. Gordon
b77f9fd47c Add Dynamic API to Android makefile. 2014-01-08 00:45:29 -05:00
Sam Lantinga
e7dba74084 Fixed bug 2146 - Enable static linking of libSDL on Android
Denis Bernard

This patch to Android.mk adds support for static linking of libSDL for Android applications. A patched readme with static build instructions is also provided.

It does not break existing build environments setup according to the README-android.txt since the static library version will not be built in not required.

The static build uses the Android NDK module system (see docs/IMPORT-MODULE.html in the NDK folder and step 5 in the instructions below).

Instructions:
1. Copy the android-project directory wherever you want to keep your projects
   and rename it to the name of your project.
2. Create a symlink to SDL/src/main/android/SDL_android_main.c as
   <project>/jni/src/SDL_android_main.c
3. Rename <project>/jni/src/Android_static.mk to <project>/jni/src/Android.mk
   (overwrite the existing one)
4. Edit <project>/jni/src/Android.mk to include your source files
5. create and export an environment variable named NDK_MODULE_PATH that points
   to the parent directory of this SDL directory. e.g.:

   export NDK_MODULE_PATH="$PWD"/..

6. Edit <project>/src/org/libsdl/app/SDLActivity.java and remove the call to
   System.loadLibrary("SDL2") line 42.
7. Run 'ndk-build' (a script provided by the NDK). This compiles the C source

Although this requires an environment variable to be setup, it can be added once and for all to the main Android.mk of the project.
2013-10-10 21:51:39 -07:00
Gabriel Jacobo
3e171ab36e Adds test framework to Android.mk and a simple utility to build Android projects 2013-10-09 10:29:01 -03:00
Ryan C. Gordon
2b9a2802b2 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module.
--HG--
extra : rebase_source : c1fac232063443a2880e64f1abda85e0bdb2e710
2013-08-20 19:57:11 -04:00
Gabriel Jacobo
ef4a588d99 Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Eric Wing
a99edf3519 Android: Removed all unnecessary dependencies on C++.
C++ is a bit of a minefield on Android. Much functionality still doesn't work, and Android can't decide on which C++ standard library to use, so it provides 3 different ones, all of which are incompatible with each other. (It looks like clang is coming too which will add a new compiler and a 4th standard library.)

As middleware, SDL might be distributed as a binary and intermixed with other projects already using C++. If C++ is intermixed in a bad way, bad things will happen. Removing dependencies on C++ will avoid this problem and downstream users won't have to worry/care.

--HG--
rename : src/core/android/SDL_android.cpp => src/core/android/SDL_android.c
rename : src/main/android/SDL_android_main.cpp => src/main/android/SDL_android_main.c
2013-07-22 02:51:45 -07:00
Sam Lantinga
46487bd122 Improved include paths for projects using SDL on Android
Isaac Burns

I wanted to suggest a few changes I've found that help the Android build.  By adding LOCAL_EXPORT_C_INCLUDES to the Android.mk file, anything that references the SDL Android project will inherit the include paths.
2013-06-17 07:14:20 -07:00
Sam Lantinga
82b0ec31cd Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android.
Philipp Wiesemann 2012-09-22 05:26:11 PDT

currently SDL (HG) does not implement the power management functionality of
SDL_GetPowerInfo() for Android.

I attached a patch which tries to implement this functionality (JNI only, API
5). It supports plugged state and battery percent return values but not
remaining seconds (which are not available on Android).
2012-09-23 01:37:44 -07:00
Sam Lantinga
ee38b15029 Updated Android Makefile for SDL2 2012-01-30 20:09:50 -05:00
Sam Lantinga
a9eeb84da2 David Carre cpasjuste@gmail.com
I'm playing with SDL on android, and did notice a problem in latest sources ( branch "default" ) :

SDL/src/render/opengles/SDL_glesfuncs.h:10: error: 'glDrawTexiOES' undeclared (first use in this function)
SDL/src/render/opengles/SDL_glesfuncs.h:10: error: (Each undeclared identifier is reported only once

If it can help you win some time here is the fix, applied to the "Android.mk" file :

LOCAL_CFLAGS += -D GL_GLEXT_PROTOTYPES
2012-01-10 21:07:09 -05:00
Sam Lantinga
58e9ea986f Fixed building on Android, added SDL_opengles2.h, removed unnecessary SDL_glesfuncs.h
--HG--
rename : src/video/SDL_glfuncs.h => src/render/opengl/SDL_glfuncs.h
2011-02-06 02:35:14 -08:00
Sam Lantinga
6ddcc36edf Fixed building for Android 2011-02-03 01:30:28 -08:00
Sam Lantinga
ada074623f Fixed Android build 2011-01-24 21:31:32 -08:00
Sam Lantinga
b4497865bd Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c

--HG--
rename : src/SDL_android.cpp => src/core/android/SDL_android.cpp
rename : src/SDL_android.h => src/core/android/SDL_android.h
2011-01-24 21:20:30 -08:00
Sam Lantinga
1bc8fe69ce Updated the atomic API for better use cases 2011-01-15 12:41:59 -08:00
Sam Lantinga
606b0cda7f Build the SDL library as a shared object on Android, so it will work correctly with SDL_image and SDL_ttf. 2011-01-06 16:11:21 -08:00