Log

Author Commit Date CI Message
Sylvain Becker 955d8789 2019-01-14T12:33:29 Android/openslES: set audio in paused/resumed state for Android event loop And also in "stopped" state before closing the device.
Sylvain Becker 59c8c7b6 2019-01-14T10:58:57 Android/openslES: move a few static variables to SDL_PrivateAudioData structure
Sylvain Becker 5aeeaaab 2019-01-14T10:16:26 Android/openslES: register and use CloseDevice function.
Sylvain Becker 365fd9c6 2019-01-14T10:04:54 Android/openslES: some space and indentation to match SDL conventions
Sam Lantinga 7dc92a76 2019-01-12T12:18:44 Initial Android OpenSL ES implementation, contributed by ANTA
Sam Lantinga fb8cb95f 2019-01-12T12:12:43 Fixed compiler warning
Sam Lantinga 390459d8 2019-01-12T12:11:06 Updated minimum supported Android version to API 16, to match latest NDK toolchain
Sylvain Becker be991f3a 2019-01-12T13:34:03 Fixed bug 4453 - GLES / GLES2: first white renderer clear cmd is drawn as black
Sylvain Becker 7b42f03f 2019-01-11T21:52:43 Android: move and group JNIEnv helper functions
Sylvain Becker 7f347830 2019-01-11T21:42:52 Android: change the way JNIEnv is retrieved - Currently, it tries to Attach the JVM first and update the thread local storage, which are two operations. Now, it simply gives back the JNI Env stored for the thread. - Android_JNI_SetupThreadi() should only be used for external. For internal SDL thread, it's already called in RunThread() (SDL_systhread.c), and other thread are Java threads which don't need to be attached. i (even if it doesn't hurt to do it, since it's a no-op). - JNI_OnLoad is filled with pthread_create, GetEnv, AttachCurrentThread... It's called for all shared libraries which may don't want this setup, and loading libraries can be also modified to be done from a static context, or with relinker. So it's not really clear how, who and what it sets up. => Reduce this function to the minimal
Sylvain Becker dc10d96c 2019-01-11T15:36:16 Android: use the same naming for JNI env local variables
Sylvain Becker 3cfd907d 2019-01-11T15:33:02 Android: Audio thread is already setup for the JVM In 'src/thread/pthread/SDL_systhread.c' RunThread() calls first 'Android_JNI_SetupThread()'
Sylvain Becker 9d82f4e9 2019-01-11T15:27:53 Android: use pthread_once for creating thread key 'mThreadKey'
Sylvain Becker 9a98e5af 2019-01-11T14:50:43 Android: don't call Android_JNI_ThreadDestroyed() for Java SDLThread SDLThread is a Java Thread, it's not needed to call 'Detach' from the JVM. Clear mThreadKey, so that the pthread_create destructor is not called for this thread.
Sylvain Becker 42e18bd0 2019-01-11T14:25:32 Android: fix bad merge from previous commit
Sylvain Becker b44a7aea 2019-01-10T21:49:00 Android: fix prototype of Android_JNI_InitTouch
Sylvain Becker 7a1d1bae 2019-01-10T21:40:57 Android: add name for Touch devices and simplification, from bug 3958
Sylvain Becker d23c2f07 2019-01-10T18:05:56 Fixed bug 3930 - Android, set thread priorities and names SDLActivity thread priority is unchanged, by default -10 (THREAD_PRIORITY_VIDEO). SDLAudio thread priority was -4 (SDL_SetThreadPriority was ignored) and is now -16 (THREAD_PRIORITY_AUDIO). SDLThread thread priority was 0 (THREAD_PRIORITY_DEFAULT) and is -4 (THREAD_PRIORITY_DISPLAY).
Sylvain Becker 0e0e0272 2019-01-10T16:04:52 Android: remove deprecated PixelFormat in surfaceChanged() Can be check by adding in build.grable: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } SDLActivity.java:1691: warning: [deprecation] A_8 in PixelFormat has been deprecated case PixelFormat.A_8: SDLActivity.java:1694: warning: [deprecation] LA_88 in PixelFormat has been deprecated SDLActivity.java:1697: warning: [deprecation] L_8 in PixelFormat has been deprecated SDLActivity.java:1700: warning: [deprecation] RGBA_4444 in PixelFormat has been deprecated SDLActivity.java:1704: warning: [deprecation] RGBA_5551 in PixelFormat has been deprecated SDLActivity.java:1716: warning: [deprecation] RGB_332 in PixelFormat has been deprecated
Sylvain Becker 5c11e5ef 2019-01-10T15:48:43 Android: some simplification, don't need mExitCalledFromJava
Sylvain Becker 66fbfe1d 2019-01-10T15:43:07 Android: nativeQuit for SDLActivity thread - destroy Android_ActivityMutex - display any SDL error message that may have occured in this thread, since SDL_GetError() is thread specific, and user has no access to it.
Sylvain Becker dad81611 2019-01-10T15:35:46 Android: only send Quit event to SDLThread if it's not already terminated And it avoids reporting errors using Android_Pause/ResumeSem that are NULL.
Sylvain Becker 61d37de0 2019-01-10T15:29:37 Android: un-needed transition to Pause state. - Don't need to go into Pause state, since onPause() has been called before. - Don't need to call nativePause is SDLThread is already ended
Sylvain Becker 8dd91550 2019-01-09T23:19:26 Android: prevent a dummy error message sending SDL_DISPLAYEVENT_ORIENTATION In the usual case, first call to onNativeOrientationChanged() is done before SDL has been initialised and would just set an error message "Video subsystem has not been initialized" without sending the event.
Sylvain Becker 02f292eb 2019-01-09T22:49:49 Android: add some SetError for Android_SetWindowFullscreen First error could happen if Android_SetWindowFullscreen somehow gets called between SurfaceDestroyed() and SurfaceCreated() Second error should not happen has native_window validity is guaranteed. (It would happens previously with error -19)
Sylvain Becker 68c0e69f 2019-01-09T22:41:52 Android: native_window validity is guaranteed between surfaceCreated and Destroyed It's currently still available after surfaceDestroyed(). And available (but invalid) between surfaceCreated() and surfaceChanged(). Which means ANativewindow_getWidth/Height/Format() fail in those cases. https://developer.android.com/reference/android/view/SurfaceHolder.html#getSurface()
Sylvain Becker 1803944b 2019-01-09T15:18:41 Android: concurrency issue for Android_SetWindowFullscreen() It accesses data->native_window, which can be changed by onNativeSurfacedChanged(). Currently, Android_SetWindowFullscreen() may access data->native_window after it has been released, and before a new reference is acquired. (can be reproduced by adding some SDL_Delay() in onNativeSurfacedChanged and Android_SetWindowFullscreen() ).
Sylvain Becker 59df6d6b 2019-01-07T17:06:50 Android: don't allow multiple instance of SDLActivity Default launch mode (standard) allows multiple instances of the SDLActivity. ( https://developer.android.com/guide/topics/manifest/activity-element#lmode ) Not sure this is intended in SDL as this doesn't work. There are static variables in Java, in C code which make this impossible (allow one android_window) and also Audio print errors. There is also some code added in onDestroy as if it would be able to re-initialize: https://hg.libsdl.org/SDL/rev/27686adb08c3 Bug Android activity life-cycle seems to show there is not transition to get out of onDestroy() https://developer.android.com/reference/android/app/Activity#ActivityLifecycle ( can be tested with "adb shell am start my.package.org/.MainActivity" and "adb shell am start -n my.package.org/.MainActivity" ) Send me a message if there are real use-case for this !
Sylvain Becker cfe2924d 2019-01-07T11:35:31 Android: some robustness when quitting application from onDestroy() Make sure there is not pending Pause accumulated, so the the application doesn't remain paused and stucked in onDestroy(). Can be tested by adding: SDLActivity.nativePause(); SDLActivity.nativePause(); mSingleton.finish();
Sylvain Becker 462e62e1 2019-01-06T20:25:54 Android: better fix for bug 3186. Run those commands from SDL thread.
Sylvain Becker 9f23d181 2019-01-06T17:35:42 Android: allow multiple calls to nativeResume() Doesn't seem to happen manually, but symetrical to the pause handling. Can be tested by adding: mNextNativeState = SDLActivity.NativeState.PAUSED; handleNativeState(); mNextNativeState = SDLActivity.NativeState.RESUMED; handleNativeState(); mNextNativeState = SDLActivity.NativeState.PAUSED; handleNativeState(); mNextNativeState = SDLActivity.NativeState.RESUMED; handleNativeState(); Before, it ends in 'paused' state. Now, it ends in 'resumed' state.
Sylvain Becker 911f1d3e 2019-01-05T22:49:50 Android: remove SURFACE_TYPE_GPU, deprecated in API level 5. https://developer.android.com/reference/android/view/SurfaceHolder This constant was deprecated in API level 5. this is ignored, this value is set automatically when needed.
Sylvain Becker e4f558a5 2019-01-05T22:46:52 Android: un-needed check of "isPausing" and minor typos
Sylvain Becker 35722b64 2019-01-05T22:27:25 Android: fix wrong state after immediate sequence pause() / resume() / pause() It may happen to have the sequence pause()/resume()/pause(), before polling any events. Before, it ends in 'resumed' state because as the check is greedy. Now, always increase the Pause semaphore, and stop at each pause. It ends in 'paused' state. Related to bug 3250: set up a reconfiguration of SurfaceView holder. Turn the screen off manually before the app starts (repro rate is not 100%..)
Sam Lantinga d4c0f498 2019-01-04T22:09:38 Fixed bug 4255 - SDL_GetGlobalMouseState() returns incorrect Y on secondary display Julian Raschke I use an open Mac laptop with an additional external monitor. The coordinate spaces from SDL_GetGlobalMouseState() and SDL_GetWindowPosition() match on the primary display, but not on the secondary display. Cocoa window coordinates are vertically flipped in relation to the primary display: https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoawindow.m#L219-L222 However, Cocoa_GetGlobalMouseState inverts the cursor Y coordinate per-display: https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoamouse.m#L320-L323 Suggested fix: Replace the for-loop with this simpler calculation: *x = (int) cocoaLocation.x; *y = (int) (CGDisplayPixelsHigh(kCGDirectMainDisplay) - cocoaLocation.y);
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sylvain Becker 2a885eb0 2019-01-04T23:39:27 Android: fixed immediate transition to pause and resume. "Pause" transition will add events: SDL_WINDOWEVENT_ENTER SDL_WINDOWEVENT_FOCUS_LOST SDL_WINDOWEVENT_MINIMIZED SDL_APP_WILL ENTER BACKGROUND SDL_APP_DID ENTER BACKGROUND "Resume" transition will add events: SDL_APP_WILL ENTER FOREGROUND SDL_APP_DID ENTER FOREGROUND SDL_WINDOWEVENT_FOCUS_GAINED SDL_WINDOWEVENT_RESTORED If Android application doesn't empty the event loop in between, it enters in "paused" state when SDL_WINDOWEVENT_RESTORED is fetched. See bug 3250 for pratical case.
Sylvain Becker cf122344 2019-01-04T23:11:21 Android: make Android_PumpEvents() more readable No behavior change in this commit.
Sylvain Becker ca184ac3 2019-01-03T23:22:50 Android: concurrency issue with egl_surface EGL_BAD_SURFACE - (bug 4142) Occurs when application goes to background: - Java activity is destroying SurfaceView holder and "egl_surface" (in onNativeSurfaceDestroyed()) - While native thread is in Android_GLES_SwapWindow(), prepared to call SDL_EGL_SwapBuffers() The error is "call to eglSwapBuffers failed, reporting an error of EGL_BAD_SURFACE" It an be reproduced easily by adding a SDL_Delay(100) at the begining of SDL_EGL_SwapBuffers(), and putting the application into background.
Sylvain Becker 2e19343d 2019-01-03T20:18:29 Android: use Mutex instead of Semphore for bug 4142
Sylvain Becker 23478642 2019-01-03T16:22:33 Android: prevent the error message from SDL_EGL_CreateSurface() to be masked.
Sylvain Becker cc8f1136 2019-01-03T14:18:06 Fixed bug 4142 - Concurrency issues in Android backend Use a semaphore to prevent concurrency issues between Java Activity and Native thread code, when using 'Android_Window'. (Eg. Java sending Touch events, while native code is destroying the main SDL_Window. )
Sylvain Becker d11f7615 2019-01-03T13:38:33 Android: minor preparation for bug 4142 (concurrency issues)
Sylvain Becker 5dc25fef 2019-01-03T13:14:16 Android: preparation bug 4142, reduce usage of global variable Android_Window
Sylvain Becker a95f91bc 2019-01-02T18:06:33 Fixed bug 3250 - Wrong backbuffer pixel format on Android, keep getting RGB_565 Use the egl format to reconfigure java SurfaceView holder format. If there is a change, it triggers a surfaceDestroyed/Created/Change sequence.
Sylvain Becker a02998a2 2019-01-02T17:41:33 Android: make sure surfaceChanged try to enter into 'resumed' state.
Sylvain Becker 4d2b5c79 2019-01-02T17:08:01 Fixed bug 4424 - Android windowed mode is broken (Thanks Jonas Thiem!)
Sylvain Becker 03b0e1de 2018-12-30T22:44:25 Android: on rare occasion, prevent Android_JNI_GetNativeWindow() from crashing If Java getNativeSurface() returns null, then ANativeWindow_fromSurface() would crash().
Sylvain Becker 1e22fc15 2018-12-30T15:41:28 Android: fixed comments and spaces
Sylvain Becker 2a412eb9 2018-12-30T15:39:37 Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground.
Sylvain Becker d09774a4 2018-12-30T14:23:25 Fixed bug 3511 - documentation to end an Android application
Sylvain Becker 9cdd0dd9 2018-12-29T17:59:34 PSP renderer: use colors from 'draw' union (very likely, but un-tested)
Sylvain Becker ebd9efb3 2018-12-29T16:37:44 opengles 1: same fix as in bug #4433
Sylvain Becker 87b76369 2018-12-29T16:34:50 opengles 1: use color from 'draw' union in SetDrawState()
Alex Szpakowski dc344360 2018-12-21T20:53:31 render: Fix internal state getting out of sync when destroying a texture that was just rendered and then creating a new one, in the GL and GLES2 backends. Fixes bug #4433.
Ryan C. Gordon 0a705901 2018-12-19T18:10:02 render: Prefer the Metal renderer over OpenGL. This is the best option for macOS and iOS, the only platforms with Metal. Pre-Metal versions of these platforms will fall back to OpenGL (ES), as appropriate. Huge thanks to Alexander Szpakowski, who worked incredibly hard to get the Metal renderer to such a high-quality state!
Alex Szpakowski c7db6ade 2018-12-19T18:27:21 metal: Implement SDL_LockTexture for YUV formats.
Alex Szpakowski ce8c716a 2018-12-18T14:23:05 metal: Implement SDL_LockTexture for non-YUV textures.
Sylvain Becker c0c8f2d7 2018-12-16T11:15:21 Gesture: remove warnings when ENABLE_DOLLAR is undefined.
Ryan C. Gordon c3e3503e 2018-12-16T01:04:07 testgl2: Press 'o' or 'p' to decrease/increase OpenGL swap interval.
Ryan C. Gordon 13869f19 2018-12-16T01:03:17 cocoa: Implement OpenGL swap interval support with CVDisplayLink. Not only does this fix macOS 10.14 ("Mojave")'s broken NSOpenGLCPSwapInterval support, it also lets us implement "adaptive vsync" on macOS! CVDisplayLink is supported back to macOS 10.4 ("Tiger"), so we just use it universally without version checks and dump NSOpenGLCPSwapInterval, Mojave or not.
Sylvain Becker 1ed60219 2018-12-15T16:21:24 Fixed bug 4426 - allows re-creation of software renderer Switching between renderers "software -> opengl -> opengles2 -> software" fails. "opengl -> opengles2" calls SDL_RecreateWindow() and frees "window->surface" without marking it as "surface_invalid".
Ryan C. Gordon 18296927 2018-12-15T09:57:05 emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index.
Sylvain Becker e5476c65 2018-12-15T14:50:12 Fixed bug 4425 - promote to alpha format, palette surface with alpha values. SDL_CreateTextureFromSurface() forgets to choose a texture format with alpha for surfaces that have palettes with alpha values.
Sam Lantinga bd08d72d 2018-12-11T20:04:10 Fixed building with the 10.10 SDK
Sam Lantinga 98829d37 2018-12-11T19:50:58 Handle both "Sony Interactive Intertainment" and "Sony Computer Entertainment" when ignoring motion sensors
Sylvain Becker 71b66451 2018-12-10T13:32:24 Rename _SDL_sensor_h in public header, not to trigger Wreserved-id-macro
Sam Lantinga 39e8e395 2018-12-08T11:22:50 Fixed bug 4379 - fix parallel build with slibtool orbea I am having a parallel build problem with -j3 or higher using the autotools build and slibtool instead of GNU libtool. Basically slibtool is faster than GNU libtool and it will start working before mkdir starts or finishes creating the build/ directory.
Sam Lantinga 1c9595b1 2018-12-08T11:06:40 Fixed bug 4415 - SDL menu bar is nonstandard on Mac foo.null I'm on macOS 10.14 and I think I'm using or around SDL 2.0.9. This is about the menu bar that SDL sets up which looks like: <App Name> <Window> <View> 1. View menu never proceeds after the Window menu in any Mac application (it is always before). 2. For SDL, the only purpose of the View menu is for a single fullscreen menu item, which is not justifiable enough to reserve space for a menu. The View menu should thus be removed, and the full screen menu item should be added at the end inside of Window's menu. See built in apps like Dictionary, Chess, App Store (on 10.14) that do this. 3. SDL should add a "Close" menu item to the Window's submenu, and it should be the first item. Its key equivalent should map to command w. Without this, you cannot close the game window via this shortcut, and you cannot close the app's About window via this shortcut. 4. Apps typically use "Enter Full Screen" or "Exit Full Screen" depending on context, not "Toggle Full Screen" which is less user friendly -- I personally care about this point the least.
Sam Lantinga 70ce0f2e 2018-12-07T12:02:08 Added the hint SDL_HINT_GAMECONTROLLERCONFIG_FILE to specify a file to load at initialization containing SDL game controller mappings
Ethan Lee 0b6e24f7 2018-12-06T14:26:18 Linux Haptic: Fix periodic.magnitude value
Sam Lantinga 898644d1 2018-12-06T09:09:05 Made it more clear that the values being compared are floats
Brandon Schaefer f9192ab8 2018-12-06T10:39:33 wayland: Do not try to lock on an invalid pointer This happens if you try to lock the pointer and (caps & WL_SEAT_CAPABILITY_POINTER) is false Leading to input->pointer being NULL which ends up bringing the wayland client down (at lease on weston)
Sylvain Becker 7468d1e0 2018-12-06T15:46:40 Fix warnings detected on Android build
Sylvain Becker 39ec1699 2018-12-06T10:24:44 opengles2: fix prototype of glDeleteBuffers
Sylvain Becker 252dc85e 2018-12-06T09:22:00 Fix warnings detected on Android build
Ryan C. Gordon a7563bcd 2018-12-05T19:03:15 joystick: Removed unused variable.
Ryan C. Gordon c7b71371 2018-12-05T17:53:38 Whoops, forgot to add a new source file. :/
Sam Lantinga 6ed76ae1 2018-12-05T14:46:03 Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows
Ryan C. Gordon fbead635 2018-12-05T16:55:59 joystick: Added controller config for IMS Passenger Control Unit Devices.
Ryan C. Gordon 2878d4f8 2018-12-05T16:53:15 egl: Don't force X11 support when testing for EGL. Fixes building Wayland support on embedded systems without X11. (TODO: maybe move the EGL test out of the X11 tests at some point, too.)
Ryan C. Gordon 1689e9f9 2018-12-05T16:51:22 linux: Move SDL_LinuxSetThreadPriority() elsewhere to fix build. Fixes Bugzilla #4393.
Ryan C. Gordon bd3ee07c 2018-12-05T16:49:38 wayland: Send SDL_TOUCH_MOUSEID mouse events for touches.
Sylvain Becker 6259a726 2018-12-05T16:13:12 Warnings: fix a documentation warning and missing prototypes
Sam Lantinga db320e46 2018-12-04T14:21:29 Fixed the PS4 motion controls showing up as a separate game controller on Linux
Sylvain Becker 69c256c1 2018-12-04T18:15:45 Fix comment and end of lines
Sylvain Becker f64c9433 2018-12-04T17:13:13 Update comment URL of USB document (HID Usage Tables 1.12)
Sylvain Becker 09b46204 2018-12-04T16:50:31 Windows: NEON detection and intrinsic includes on Visual Studio Visual Studio doesn't define __ARM_ARCH nor _ARM_NEON, but _M_ARM and _M_ARM64, so SDL_HasNEON() was bypassed. PF_ARM_NEON_INSTRUCTIONS_AVAILABLE doesn't see to be defined (but still works when defined as 19).
Sylvain Becker aea7e56a 2018-12-04T12:34:45 android: use __ARM_NEON instead of __ARM_NEON__ to include <arm_neon.h> Only __ARM_NEON is defined with Android NDK and arm64-v8a Tested on ndk-r18, ndk-r13 and also Xcode. (Visual Studio needs a different fix). Fixes Bugzilla #4409.
Ryan C. Gordon cca9d24c 2018-12-03T09:26:05 direct3d: be more aggressive about resetting invalidated cached state. Fixes Bugzilla #4402.
Ryan C. Gordon 939bf1c4 2018-12-03T02:06:17 render: fix some static analysis warnings.
Ryan C. Gordon 33f78eb1 2018-12-03T01:58:23 direct3d: Make sure streaming textures update before being used for drawing. Fixes Bugzilla #4402.
Ryan C. Gordon b744108a 2018-12-02T21:57:33 Patched to compile on C89 compilers.
Ryan C. Gordon 3c936150 2018-12-02T20:55:57 direct3d: Release and NULL out vertex buffers on reset. Otherwise they are irretrievably lost on window resize, etc, which makes rendering freeze and other disasters. Fixes Bugzilla #4358.
Ryan C. Gordon d4a21f54 2018-12-02T02:43:32 cmake: Comment out some debug logging that can upset build environments. Something about the dashes, colons, numbers makes some builders believe this is an error message.
Ryan C. Gordon 65a7c98c 2018-12-02T02:33:06 directfb: Updated render backend to new internal API. Totally untested, beyond it now compiles again. Probably needs some fixes. Fixes Bugzilla #4405.
Sergey Zhuravlevich 583f61b2 2018-12-01T16:31:56 kmsdrm: Check for resources when validating KMSDRM device in check_modesetting. Fixes Bugzilla #4403.
Sergey Zhuravlevich b3ac87d5 2018-12-01T13:09:00 kmsdrm: uninitialized KMSDRM fixes * Search for valid encoder in connector when it doesn't have an encoder ID set. * Search for valid CRTC in resources and encoder's possible CRTCs when encoder doesn't have one set. * Select default mode if CRTC doesn't have a valid one. * Pick current_mode's W/H/Refresh Rate basing on current and valid CRTC mode, not the saved one.
Ryan C. Gordon 3323b355 2018-12-01T12:19:11 android: use cpufeatures to support SDL_HasNEON() (thanks, Sylvain!). Fixes Bugzilla #4406.
Ryan C. Gordon 1e4acca8 2018-12-01T12:17:34 Added some detail to a Doxygen comment (thanks, Sylvain!).