Commit Graph

49 Commits

Author SHA1 Message Date
Sam Lantinga
6a6db94f54 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Sam Lantinga
a7f26f9e6c 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
Ethan Lee
8c5c6c609f SDL_exp 2018-08-04 11:52:46 -04:00
Ethan Lee
ff50cc0958 SDL_log10 2018-01-17 11:53:09 -05:00
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
644c159d94 Added SDL_fmod() and SDL_fmodf() 2017-11-04 17:35:03 -07:00
Sam Lantinga
84dfc945e8 Android doesn't have libunwind.h in API 16 2017-10-12 14:21:21 -07:00
Sam Lantinga
eea9c57d52 Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
2017-10-12 13:44:28 -07:00
Sam Lantinga
af35942108 Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits
Simon Hug

When RWops seeks with fseek or fseeko it uses the types long or off_t which can be 32 bits on some platforms. stdio_seek does not check if the 64-bit integer for the offset fits into a 32-bit integer. Offsets equal or larger than 2 GiB will have implementation-defined behavior and failure states would be very confusing to debug.

The attached patch adds range checking by using the macros from limits.h for long type and some bit shifting for off_t because POSIX couldn't be bothered to specify min and max macros.

It also defines HAVE_FSEEKI64 in SDL_config_windows.h so that the Windows function gets picked up automatically with the default config.

And there's an additional error message for when ftell fails.
2017-09-09 08:36:37 -07:00
Sam Lantinga
ae48232ed1 Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration 2017-08-28 00:11:38 -07:00
Ryan C. Gordon
10d552ae31 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Sam Lantinga
bc7363f38d 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
44823377c0 Updated config headers to override the base SDL_config.h if both are included 2017-02-20 10:55:33 -08:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
5fe69a18f5 Fixed bug 2758 - Android issues with NDK r10c and API-21
Sylvain

After a long time, I found out more clearly what was going wrong.

The native libraries should be built with a "APP_PLATFORM" as low as possible.
Ideally, APP_PLATFORM should be equals to the minSdkVersion of the AndroidManifest.xml
So that the application never runs on a lower APP_PLATFORM than it has been built for.

An additional good patch would be to write explicitly in "jni/Application.mk": APP_PLATFORM=android-10

(If no APP_PLATFORM is set, the "targetSdkVersion" of the AndroidManifest.xml is applied as an APP_PLATFORM to the native libraries. And currently, this is bad, because targetSdkVersion is 12, whereas minSdkLevel is 10.
And in fact, there is a warning from ndk: "Android NDK: WARNING: APP_PLATFORM android-12 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml".)


to precise what happened in the initial reported test-case:
Let say the "c" code contains a call to "srand()".

with APP_PLATFORM=android-21, libSDL2.so contains a undef reference to "srand()".
with APP_PLATFORM=android-10, libSDL2.so contains a undef reference to "srand48()".

but srand() is missing on devices with APP_PLATFORM=android-10 (it was in fact replaced by srand48()).
So, if you build for android-21 (where srand() is available), you will really have a call to "srand()" and it will fail on android-10.
That was the issue. The path tried to fix this by in fact always calling srand48().


SDL patches that were applied are beneficial anyway, there are implicitly allowing they backward compatibility of using android-21 on a android-10 platform.
It can be helpful in case you want to target a higher APP_PLATFORM than minSdkVersion to have potentially access to more functions.
Eg you want to have access to GLES3 functions (or other) of "android-21". But, if dlopen() fails (on android-10), you do a fall-back to GLES2.
2016-10-14 06:57:55 -07:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
5ac1d2ab15 Android has clock_gettime() - thanks Michael Labbe! 2015-06-19 23:40:23 -07:00
Sam Lantinga
de541d5072 Partial fix for bug 2758 - Android issues with NDK r10c and API-21
Sylvain

When using API 21 and running on an old device (android < 5.0 ?) some function are missing.

functions are (at least) : signal, sigemptyset, atof, stpcpy (strcat and strcpy), srand, rand.


Very few modifications on SDL to get this working :

on SDL
======

Undefine android configuration :

HAVE_SIGNAL
HAVE_SIGACTION
HAVE_ATOF

In "SDL_systrhead.c", comment out the few block of lines with "sigemptyset".

Android.mk:
remove the compilation of "test" directory because it contains a few rand/srand calls

Also, there are more discussions about this in internet :
https://groups.google.com/forum/#!topic/android-ndk/RjO9WmG9pfE
http://stackoverflow.com/questions/25475055/android-ndk-load-library-cannot-locate-srand
2015-06-17 00:07:45 -07:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
47f40262b5 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga
18fc7db9e2 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07:00
Sam Lantinga
4b39a2f46b Implemented SDL_GetPrefPath() on Android - it returns the path used by SDL_AndroidGetInternalStoragePath() 2014-08-11 17:25:53 -07:00
Sam Lantinga
e1683fad67 Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Ryan C. Gordon
258c05aa3e We don't need to check for snprintf() anymore, we don't use it.
SDL_snprintf() is built on vsnprintf() where available.
2013-11-24 23:36:15 -05:00
Ryan C. Gordon
df9f367941 Added SDL_vsscanf(). 2013-11-24 23:35:38 -05:00
Gabriel Jacobo
2932d59103 [Android] Define SDL_VIDEO_OPENGL_ES2 2013-12-16 10:03:26 -03:00
Ryan C. Gordon
fac8b02737 Hook up SDL_acos and SDL_asin properly. 2013-12-09 15:17:20 -05:00
Ryan C. Gordon
8fe1cf47f2 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Gabriel Jacobo
84f07d804a Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Sam Lantinga
8425cf5d1a Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
e52130b426 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
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
f0c424685b SDL 1.3 requires a 64-bit type for the platform. 2011-03-25 13:47:49 -07:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
bbf99fa10b Fixed building on Android, added SDL_opengles2.h, removed unnecessary SDL_glesfuncs.h 2011-02-06 02:35:14 -08:00
Sam Lantinga
8bbd554984 Fixed permissions on the Android config header. 2011-02-05 01:02:24 -08:00
Sam Lantinga
6da7a17174 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
Sam Lantinga
49a4522f6f Fixed 2D video on Android
There was a dummy renderer left in there which was overriding the OpenGL ES renderer.
2011-01-04 20:36:39 -08:00
Sam Lantinga
80b28b58d8 Android has atan() and atan2() 2011-01-01 16:56:54 -08:00
Paul Hunkin
eb38d6aa71 - Cleaned up a bunch of code
- Added 'feature' enable/disable so we're not running accel/sound/whatever in Java when we don't need to be
- More work on the sound system. But it still crashes pretty horribly, not sure why yet.
2010-07-27 21:21:24 +02:00
Paul Hunkin
daa451a473 Oops, I wasn't using pthreads. Fixed so we can have mutexes and stuff 2010-07-27 15:23:09 +02:00
Paul Hunkin
10203b606f Updated test app to init the sound system 2010-07-27 11:35:06 +02:00
Paul Hunkin
61ddab05c6 Added (partially implemented) android video backend and associated files needed to build 2010-06-10 18:54:23 +12:00
Paul Hunkin
99ccaa6680 Added some android build stuff 2010-05-23 15:18:16 +12:00