Commit Graph

10930 Commits

Author SHA1 Message Date
Sylvain Becker
ff091d266b 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.
2019-01-03 23:22:50 +01:00
Sylvain Becker
ad871deb8c Android: use Mutex instead of Semphore for bug 4142 2019-01-03 20:18:29 +01:00
Sylvain Becker
312c1f152f Android: prevent the error message from SDL_EGL_CreateSurface() to be masked. 2019-01-03 16:22:33 +01:00
Sylvain Becker
9b712a0672 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. )
2019-01-03 14:18:06 +01:00
Sylvain Becker
dbeee676b1 Android: minor preparation for bug 4142 (concurrency issues) 2019-01-03 13:38:33 +01:00
Sylvain Becker
0c4bea8284 Android: preparation bug 4142, reduce usage of global variable Android_Window 2019-01-03 13:14:16 +01:00
Sylvain Becker
d81254cc3f 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.
2019-01-02 18:06:33 +01:00
Sylvain Becker
976804d92e Android: make sure surfaceChanged try to enter into 'resumed' state. 2019-01-02 17:41:33 +01:00
Sylvain Becker
00faa5cff7 Fixed bug 4424 - Android windowed mode is broken (Thanks Jonas Thiem!) 2019-01-02 17:08:01 +01:00
Sylvain Becker
daab818ebb Android: on rare occasion, prevent Android_JNI_GetNativeWindow() from crashing
If Java getNativeSurface() returns null, then ANativeWindow_fromSurface() would crash().
2018-12-30 22:44:25 +01:00
Sylvain Becker
a4c2a3bd4b Android: fixed comments and spaces 2018-12-30 15:41:28 +01:00
Sylvain Becker
3309f23c7f Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground. 2018-12-30 15:39:37 +01:00
Sylvain Becker
8993416859 Fixed bug 3511 - documentation to end an Android application 2018-12-30 14:23:25 +01:00
Sylvain Becker
5462c25419 PSP renderer: use colors from 'draw' union (very likely, but un-tested) 2018-12-29 17:59:34 +01:00
Sylvain Becker
8030ccc6b4 opengles 1: same fix as in bug #4433 2018-12-29 16:37:44 +01:00
Sylvain Becker
17d90ebcd0 opengles 1: use color from 'draw' union in SetDrawState() 2018-12-29 16:34:50 +01:00
Alex Szpakowski
04e747196e 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. 2018-12-21 20:53:31 -04:00
Ryan C. Gordon
8b4f8f851f 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!
2018-12-19 18:10:02 -05:00
Alex Szpakowski
1fef0780b0 metal: Implement SDL_LockTexture for YUV formats. 2018-12-19 18:27:21 -04:00
Alex Szpakowski
ab8c8b57d7 metal: Implement SDL_LockTexture for non-YUV textures. 2018-12-18 14:23:05 -04:00
Sylvain Becker
2173eb6d89 Gesture: remove warnings when ENABLE_DOLLAR is undefined. 2018-12-16 11:15:21 +01:00
Ryan C. Gordon
72f602c79b testgl2: Press 'o' or 'p' to decrease/increase OpenGL swap interval. 2018-12-16 01:04:07 -05:00
Ryan C. Gordon
29cddbeb9e 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.
2018-12-16 01:03:17 -05:00
Sylvain Becker
a58204aea8 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".
2018-12-15 16:21:24 +01:00
Ryan C. Gordon
846c482a3f emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index. 2018-12-15 09:57:05 -05:00
Sylvain Becker
cdf7a0983c 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.
2018-12-15 14:50:12 +01:00
Sam Lantinga
d7acbcb086 Fixed building with the 10.10 SDK 2018-12-11 20:04:10 -08:00
Sam Lantinga
4469ad91c6 Handle both "Sony Interactive Intertainment" and "Sony Computer Entertainment" when ignoring motion sensors 2018-12-11 19:50:58 -08:00
Sylvain Becker
cd71253d78 Rename _SDL_sensor_h in public header, not to trigger Wreserved-id-macro 2018-12-10 13:32:24 +01:00
Ethan Lee
a986af18b5 Linux Haptic: Fix periodic.magnitude value 2018-12-06 14:26:18 -05:00
Sam Lantinga
5a48ed4d5c 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.
2018-12-08 11:22:50 -08:00
Sam Lantinga
32901d0708 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.
2018-12-08 11:06:40 -08:00
Sam Lantinga
dbcd123784 Added the hint SDL_HINT_GAMECONTROLLERCONFIG_FILE to specify a file to load at initialization containing SDL game controller mappings 2018-12-07 12:02:08 -08:00
Sam Lantinga
63d015779f Made it more clear that the values being compared are floats 2018-12-06 09:09:05 -08:00
Brandon Schaefer
23ea1fd4db 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)
2018-12-06 10:39:33 -05:00
Sylvain Becker
ec5785a4b8 Fix warnings detected on Android build 2018-12-06 15:46:40 +01:00
Sylvain Becker
6832c29cfb opengles2: fix prototype of glDeleteBuffers 2018-12-06 10:24:44 +01:00
Sylvain Becker
64aff1d0b1 Fix warnings detected on Android build 2018-12-06 09:22:00 +01:00
Ryan C. Gordon
d1ea368531 joystick: Removed unused variable. 2018-12-05 19:03:15 -05:00
Ryan C. Gordon
0acdb33214 Whoops, forgot to add a new source file. :/ 2018-12-05 17:53:38 -05:00
Sam Lantinga
403d1aef1d Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows 2018-12-05 14:46:03 -08:00
Ryan C. Gordon
735a841848 joystick: Added controller config for IMS Passenger Control Unit Devices. 2018-12-05 16:55:59 -05:00
Ryan C. Gordon
b580d9c4e3 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.)
2018-12-05 16:53:15 -05:00
Ryan C. Gordon
9f4e7d454e linux: Move SDL_LinuxSetThreadPriority() elsewhere to fix build.
Fixes Bugzilla #4393.
2018-12-05 16:51:22 -05:00
Ryan C. Gordon
e1975f2f78 wayland: Send SDL_TOUCH_MOUSEID mouse events for touches. 2018-12-05 16:49:38 -05:00
Sylvain Becker
a8ad1e236c Warnings: fix a documentation warning and missing prototypes 2018-12-05 16:13:12 +01:00
Sam Lantinga
2cd60a394a Fixed the PS4 motion controls showing up as a separate game controller on Linux 2018-12-04 14:21:29 -08:00
Sylvain Becker
93ad3ca778 Fix comment and end of lines 2018-12-04 18:15:45 +01:00
Sylvain Becker
2047f1b79f Update comment URL of USB document (HID Usage Tables 1.12) 2018-12-04 17:13:13 +01:00
Sylvain Becker
4d795d9e9b 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).
2018-12-04 16:50:31 +01:00