Commit Graph

10158 Commits

Author SHA1 Message Date
Sam Lantinga
48bcdfd8cc Added float versions of SDL's math functions 2017-11-04 15:34:14 -07:00
Sam Lantinga
325dff1cb1 Fixed using libunwind on iOS, where it's only available on the simulator (thanks Vit!) 2017-11-04 09:44:29 -07:00
Sam Lantinga
46bbc5d328 Fixed bug 3917 - Android, issues with getManifestEnvironmentVariable
We're going to push the manifest environment variables from the Java side instead of continually querying for them from the native side.
2017-11-04 09:37:29 -07:00
Sam Lantinga
79b0c8af83 Fixed bug 3940 - Add support for EGL_SURFACE_TYPE
tomwardio

Add support to be able to set EGL_SURFACE_TYPE bits when creating an EGL config. This is usefule when wanting to create pixel buffer surfaces in custom video drivers.
2017-11-04 09:07:33 -07:00
Conn O'Griofa
3ad3120f32 Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
* The brcmGLESv2 vendor library also supports ES PVR/1 profiles
* Fallback to standard Mesa libraries if the VC4 driver is loaded
2017-11-04 09:04:19 -07:00
Conn O'Griofa
3a9d15b4da SDL_video: try to bootstrap KMSDRM before RPI video driver
Allow better coexistence between RPI's vendor libraries and VC4 mesa driver.
2017-11-04 09:03:20 -07:00
Sam Lantinga
30962f0b83 Android configure-based build fixes (thanks Vit!) 2017-11-04 09:00:40 -07:00
Johannes Bader
a531ac1b76 Emscripten: use cursor hotspot
the cursor's hotspot simply wasn't translated to it's CSS equivalent, yet
see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor?v=example#Syntax. no explicit hotspot if (0|0) for compatibility with Edge and IE, which indeed don't support custom hot spots
2017-11-04 11:16:49 +00:00
Sam Lantinga
65195e610d Make SDL fullscreen windows on Android actually fullscreen 2017-11-02 10:41:55 -07:00
Sam Lantinga
6a33d1a746 Fixed bug 3935 - Not find joysticks if android run 24-48 days.
Alexander Orefkov

In src\joystick\android\SDL_sysjoystick.c in SDL_SYS_JoystickDetect when SDL_GetTicks return number grater 2147483648 (after 24.85 days uptime) SDL_TICKS_PASSED(SDL_GetTicks(), timeout) return FALSE and Android_JNI_PollInputDevices is never calling.
And in JoystickByDeviceId - when search for newly added joystic - after SDL_SYS_JoystickDetect item not reinitilized, and always stay NULL, cause return NULL instead of added joystick.
2017-11-02 08:48:14 -07:00
Sam Lantinga
084cfc4173 Fixed bug 3933 - Android, no need of the listener thread
Sylvain

A listener thread has been added to know when the native thread would end.
But now, it is more easy to only check that after the main function has returned. It's one thread less.
2017-11-02 08:46:14 -07:00
Sam Lantinga
62d6c387e8 Fixed bug 3917 - Android, issues with getManifestEnvironmentVariable
Sylvain

Some issue with this commit:
https://hg.libsdl.org/SDL/rev/4130b92b6be4

There is a memory allocation missing.
2017-11-01 19:19:21 -07:00
Sam Lantinga
b4e2edf099 Allow the activity to persist through connecting or disconnecting a keyboard 2017-11-01 18:41:11 -07:00
Sam Lantinga
efa038fbaf Moved the meta-data into the right section 2017-11-01 18:40:11 -07:00
Sam Lantinga
bb156ce5ec Fixed bug 3926 - SDL_main export
e_pluschauskas

I noticed that after updating SDL to 2.0.6 my application now exports SDL_main.

At GitHub SDL mirror (branch 2.0.5) SDL_main prototyped as
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
but at branch 2.0.6 prototype is
extern C_LINKAGE DECLSPEC int SDL_main(int argc, char *argv[]);
2017-11-01 17:41:25 -07:00
Sam Lantinga
bcfba1fc8a Fixed bug 3932 - Android, GetDisplayDPI release local reference
Sylvain

When writing JNI code, one has to make sure all local references are released otherwise the app end up crashing.
2017-11-01 17:30:02 -07:00
Sam Lantinga
4081459702 Fixed building on non-Android platforms 2017-11-01 10:07:04 -07:00
Sam Lantinga
98af57285f Added controller mapping for Android TV remotes
Also fixed the back button on the remote exiting the application
2017-11-01 10:06:58 -07:00
Sam Lantinga
8c4dc3c464 Add SDL_GetDisplayDPI implementation on Android. (thanks Rachel!) 2017-10-31 13:49:59 -07:00
David Ludwig
6ac44b9bba WinRT: Move Windows::Foundation::Initialize to SDL2.dll, from SDL_main.
This allows C# UWP applications to use SDL2's SDL_WinRTRunApp function.

Kudos to Ethan Lee (flibitijibibo@flibitijibibo.com) for the patch.  Thanks!
2017-10-24 13:21:11 -04:00
Sam Lantinga
082143db78 Fixed Java string comparison with "" 2017-10-29 21:09:09 -07:00
Sam Lantinga
990a5258af Added the old ant Android build project structure 2017-10-28 12:11:25 -07:00
Brandon Schaefer
02c0174483 Fixed bug 3902 - Add a specific KMSDRM hint for low latency video 2017-10-26 16:37:20 -07:00
Sam Lantinga
b9c87556fb Updated SDL iOS project for tvOS 2017-10-26 10:49:33 -07:00
Sam Lantinga
88ae51606d Added missing keyinfotable.h 2017-10-26 10:42:14 -07:00
Sam Lantinga
d985978f55 android: Fix softkeyboard issue in SDL on Android. 2017-10-26 10:41:38 -07:00
Ryan C. Gordon
7ecdde2631 cocoa: Don't change the NSWindow background color.
Changing the background color causes the titlebar to blend against it on
modern macOS releases, making all SDL windows look wrong by default. This was
set to make the window not flash white before a GL context is ready, but we
can accomplish this in our window's view's drawRect implementation, too.
2017-10-25 18:02:11 -04:00
Sam Lantinga
467aa0904e Added the ability to set SDL hints from AndroidManifest.xml (thanks Rachel!)
This is especially useful for things like the accelerometer hint which could be needed before application main().
2017-10-24 00:17:07 -07:00
Sam Lantinga
7658113c79 Fixed crash if mSurface isn't set up when we pause the application 2017-10-24 00:04:40 -07:00
Sam Lantinga
ef9f4473dc Removed unneeded file automatically generated by Android Studio 2017-10-23 23:35:04 -07:00
Sam Lantinga
95e883fbda Updated the minimum and target SDK versions in AndroidManifest.xml 2017-10-23 23:26:40 -07:00
Sam Lantinga
be3cbc7751 Updated Android build tools version, which bumped minimum deployment target to API 14
Also added native code to the Android gradle project, which allows using gradle or Android Studio to build the entire SDL application without a separate ndk-build step.
2017-10-23 23:23:47 -07:00
Sam Lantinga
108a029672 Fixed build with older Android SDK 2017-10-23 23:23:34 -07:00
Sam Lantinga
b0c78879e9 Switched to new style gradle Android application build process 2017-10-23 15:23:43 -07:00
Sam Lantinga
0c8fe5a63c Added tag release-2.0.7 for changeset 2088cd828335 2017-10-23 12:33:18 -07:00
Sven Hesse
236c143dd4 Don't X error in SDL_CreateWindow with unsupported GL attributes 2017-10-22 20:24:58 +02:00
Sam Lantinga
b9c2f1c58f Added Visual Studio solution files for WinRT projects 2017-10-21 22:26:24 -07:00
Sam Lantinga
5dd66f2899 Fixed bug 3901 - Fix vsync-ed pageflips on the KMSDRM video driver
Manuel

I noticed that, at least on Intel GPU hardware, passing SDL_RENDERER_PRESENTVSYNC would result on a static console instead of the program graphics.
That was due to the fact that calling drmModePageFlip() only works if we have previously set up CRTC to one of the GBM buffers with a drmModeSetCrtc() call, so now it's done and things work as expected.

The KMSDRM_GLES_SetupCrtc() call is done only one time, only when needed (when egl_swapinterval is not 0: when it's 0, there's no need for it because we flip by calling drmModePageFlip() anyway).
The place where KMSDRM_GLES_SetupCrtc() call is done may look strange, but it's right: it needs EGL completely ready because it needs to call eglSwapBuffers() internally to work (see more comments about it in the code).
2017-10-21 04:20:57 -07:00
Sam Lantinga
765e991000 Fixed typo converting 4 channel audio to 2 channel 2017-10-20 16:53:42 -07:00
Sam Lantinga
7cb271f718 Added a note about adjusting channel weights when converting to fewer channels 2017-10-20 14:51:22 -07:00
Sam Lantinga
1e63db4504 Document the SDL audio channel mapping 2017-10-20 14:48:10 -07:00
Sam Lantinga
ff2da1f583 Added SDL_AudioStreamFlush() to the list of new audio stream functions 2017-10-20 10:45:38 -07:00
Sam Lantinga
dfec20b5f5 Reverted changes a970b2ae1bd7 and 4a94743e31fe
I don't want to introduce any regressions with Android TV remote support
2017-10-20 10:29:22 -07:00
Sam Lantinga
04affe2c5e Fixed Android joystick detection 2017-10-19 15:37:52 -07:00
Ryan C. Gordon
ba79be8ef6 audio: Added SDL_AudioStreamFlush(). 2017-10-19 18:05:42 -04:00
Sam Lantinga
01f3a63f9c Don't use DPAD devices as joystick input on Android 2017-10-19 13:54:56 -07:00
Ryan C. Gordon
09b2171103 Check correct variable for malloc() results. 2017-10-18 23:49:46 -04:00
Sam Lantinga
948387965d Fixed bug 3876 - Resampling of certain sounds adds heavy distortion
Simon Hug

Patch that adds [-1, 1] clamping to the scalar audio type conversions.

This may come from the SDL_Convert_F32_to_X_Scalar functions. They don't clamp the float value to [-1, 1] and when they cast it to the target integer it may be too large or too small for the type and get truncated, causing horrible noise.

The attached patch throws clamping in, but I don't know if that's the preferred way to fix this. For x86 (without SSE) the compiler (I tested MSVC) seems to throw a horrible amount of x87 code in it. It's a bit better with SSE, but probably still quite the performance hit. And SSE2 uses a branchless approach with maxss and minss.
2017-10-18 19:30:47 -07:00
Sam Lantinga
f6db48f792 Added a staging buffer to the audio stream so that we can accumulate small amounts of data if needed when resampling 2017-10-18 19:26:36 -07:00
Sam Lantinga
34f15d9394 Added audio stream conversion functions:
SDL_NewAudioStream
    SDL_AudioStreamPut
    SDL_AudioStreamGet
    SDL_AudioStreamAvailable
    SDL_AudioStreamClear
    SDL_FreeAudioStream
2017-10-18 15:54:05 -07:00