Commit graph

53 commits

Author SHA1 Message Date
Sam Lantinga
6b6170caf6 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Ozkan Sezer
79725cdb32 added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.) 2019-11-20 20:40:50 +03:00
Sam Lantinga
57c735236b Initial Android OpenSL ES implementation, contributed by ANTA 2019-01-12 12:18:44 -08:00
Sam Lantinga
af32a2f4cd Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sam Lantinga
09c276f295 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07: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
Ethan Lee
54ce812205 SDL_exp 2018-08-04 11:52:46 -04:00
Ethan Lee
8551a596fa SDL_log10 2018-01-17 11:53:09 -05:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
4e9aab5884 Added SDL_fmod() and SDL_fmodf() 2017-11-04 17:35:03 -07:00
Sam Lantinga
28cbe2df82 Android doesn't have libunwind.h in API 16 2017-10-12 14:21:21 -07:00
Sam Lantinga
4d7a2db434 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
73a2b9ace8 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
15cb6b4932 Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration 2017-08-28 00:11:38 -07:00
Ryan C. Gordon
a566435db1 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.

--HG--
extra : rebase_source : cb3bb332146125366b5242c0d7444f44638733d9
extra : amend_source : c72ebb6d3a92efc3fdd085ce3b6d4b1d7f573cc9
2017-08-27 22:15:57 -04: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
c1277f268e Updated config headers to override the base SDL_config.h if both are included 2017-02-20 10:55:33 -08:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
91e0a1d094 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
df4c882923 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
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
e144065e28 Android has clock_gettime() - thanks Michael Labbe! 2015-06-19 23:40:23 -07:00
Sam Lantinga
b15e71afdc 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
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
b3e4782510 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga
5acb7c63d1 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07: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
276b7efecd Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Ryan C. Gordon
de59025dac We don't need to check for snprintf() anymore, we don't use it.
SDL_snprintf() is built on vsnprintf() where available.

--HG--
extra : rebase_source : fef7988e29ab9293c7ae9ba3cff3f86c7e59e345
2013-11-24 23:36:15 -05:00
Ryan C. Gordon
3003efb88d Added SDL_vsscanf().
--HG--
extra : rebase_source : 088d093790a7ed95d73c307523587e95c8356f4b
2013-11-24 23:35:38 -05:00
Gabriel Jacobo
fc92786842 [Android] Define SDL_VIDEO_OPENGL_ES2 2013-12-16 10:03:26 -03:00
Ryan C. Gordon
924207a299 Hook up SDL_acos and SDL_asin properly. 2013-12-09 15:17:20 -05: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
Sam Lantinga
91452f6355 Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08: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
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
5c01c4797c SDL 1.3 requires a 64-bit type for the platform. 2011-03-25 13:47:49 -07:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08: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
08c975d3ab Fixed permissions on the Android config header. 2011-02-05 01:02:24 -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
Sam Lantinga
63925f3c8f 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
b369f1945a Android has atan() and atan2() 2011-01-01 16:56:54 -08:00
Paul Hunkin
ef47472280 - 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
9aea3f99a7 Oops, I wasn't using pthreads. Fixed so we can have mutexes and stuff 2010-07-27 15:23:09 +02:00