Charlie Birks
e9c3c358bb
Emscripten: Use set_canvas_element_size
...
This will be needed for supporting multiple canvases and set_canvas_size
is deprecated anyway.
2019-01-29 12:18:56 +00:00
kichikuou
7bed1aea38
Emscripten: Do not consume mouseup event outside of the canvas
2019-01-29 12:14:54 +00:00
Sylvain Beucler
31a1284924
Emscripten: fix duplicate mousebuttonup/mousebuttondown events when touch events are disabled
2019-01-29 12:14:44 +00:00
Charlie Birks
4901168267
Emscripten: use a fake size for external sizing check
...
The check would fail if the canvas happened to be the correct size
already. (#66 , mentioned in #58 )
2019-01-29 12:14:41 +00:00
Charlie Birks
87ed183209
Emscripten: reset fullscreen_window when leaving fullscreen
...
If the browser left fullscreen mode by the user pressing ESC, the next
call to SDL_SetWindowFullscreen(1) will fail as it thinks the window is
already fullscreen. (#65 )
2019-01-29 12:14:33 +00:00
Sylvain Becker
2158e9868f
Fixed bug 4024 - GameController error "Unexpected controller element"
...
If mapping string is terminated with a comma, there is no more values to parse.
2019-01-21 23:41:43 +01:00
Sylvain Becker
f2d8b8063f
Revert SDL_gamecontrollerdb.h and sort_controllers.py from bug 4024
2019-01-21 20:49:08 +01:00
Sylvain Becker
68694b625a
Fixed bug 3827 - issue with MapRGB, palette and colorkey
...
For palette surface, SDL_MapRGB() returns different values whether colorkey is
set or not.
2019-01-21 19:53:06 +01:00
Sylvain Becker
7804004243
Fixed bug 3827 - issue with MapRGB, palette and colorkey
...
For a palettized surface, prevent SDL_MapRGB() value to change whether colorkey is set or not.
2019-01-21 18:45:15 +01:00
Sam Lantinga
d52ff47b91
Fixed compiler warning
2019-01-20 13:53:16 -08:00
Sylvain Becker
d8de894591
Android: some typos
2019-01-20 22:17:41 +01:00
Sylvain Becker
287f3059f4
Android: automatically attach to the JVM non-SDL threads
...
It allows a thread created with pthread_create() to access the JNI Env
2019-01-20 22:11:56 +01:00
Sam Lantinga
e6b7619e67
Fixed compiler warning on Android
2019-01-20 12:02:12 -08:00
Sylvain Becker
e1e05d5d70
Fixed bug 3657 - Color-key doesn't work when an alpha channel is present
...
When surface format is the same as renderer format, it still needs an
intermediate conversion to transform colorkey to alpha.
2019-01-19 16:47:43 +01:00
Sylvain Becker
9b47e84e5f
Android: remove duplicate code in SDLGenericMotionListener_API24
...
and use parent method
2019-01-17 16:30:19 +01:00
Sylvain Becker
9fe9f944c4
Android: remove another hard-coded constant for Samsung DeX (no op!)
2019-01-17 14:59:46 +01:00
Sylvain Becker
6b00cbb96e
Android: minor change in the evaluation of SOURCE_CLASS_JOYSTICK (no op!)
...
InputDevice.SOURCE_CLASS_* are one bit
More readable to check that the source has this class_joystick set,
compared to the other statements, where the source is gamepad or dpad.
(Clean-up from bug 3958)
2019-01-17 13:42:13 +01:00
Sylvain Becker
55564d0ca1
Android: remove hard-coded constant for Samsung DeX (no op!)
...
12290 = 0x3002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
SOURCE_MOUSE Constant Value: 8194 (0x00002002)
SOURCE_TOUCHSCREEN Constant Value: 4098 (0x00001002)
SOURCE_CLASS_POINTER Constant Value: 2 (0x00000002)
https://developer.android.com/reference/android/view/InputDevice.html
2019-01-17 12:25:19 +01:00
Sylvain Becker
d9931045f2
Android: prevent concurrency in Android_SetScreenResolution() when exiting
...
by checking Android_Window validity
- SDLThread: user application is exiting:
SDL_VideoQuit() and clearing SDL_GetVideoDevice()
- ActivityThread is changing orientation/size
surfaceChanged() > Android_SetScreenResolution() > SDL_GetVideoDevice()
- Separate function into Android_SetScreenResolution() and Android_SendResize(),
formating, and mark Android_DeviceWidth/Heigh as static
2019-01-17 11:05:05 +01:00
Sylvain Becker
9a1a6cec9d
Android: also update APP_PLATFORM to android-16 in Application.mk
...
https://hg.libsdl.org/SDL/rev/8db358c7a09a
https://hg.libsdl.org/SDL/rev/787e86a461f5
2019-01-17 09:28:30 +01:00
Sylvain Becker
f391324f91
Fixed bug 4024 - remove trailing comma of Controller mappings
...
because it reports an error "Unexpected controller element"
2019-01-16 14:03:35 +01:00
Sylvain Becker
e241cfa32f
Android: add mutex protection to onNativeOrientationChanged
...
it's possible receive try to send an event between the check first for SDL_GetVideoDevice
and SDL_VideoQuit is called
2019-01-16 10:48:28 +01:00
Sylvain Becker
28602e239c
Android: move static variable isPaused/isPausing to SDL_VideoData structure
...
- remove unneed check to Android_Window->driverdata
- add window check into context_backup/restore
2019-01-16 10:31:51 +01:00
Sylvain Becker
f9373b63b3
Android: merge SDLJoystickHandler_API12 and SDLJoystickHandler_API16
2019-01-16 09:22:20 +01:00
Sylvain Becker
9b5390c0f1
Android: remove trailing spaces
2019-01-16 09:12:31 +01:00
Sylvain Becker
68f12e3786
Android: remove old code after Android-16 has been set as minimum requirement
2019-01-16 09:11:13 +01:00
Ryan C. Gordon
9654d91230
evdev: don't debug log on a BTN_TOUCH from a non-touch device.
2019-01-14 19:43:25 -05:00
Ryan C. Gordon
a6a92f73d3
evdev: Add touchscreen mouse emulation and pressure support (thanks, Zach!).
...
This also solves reports of this log message:
"INFO: The key you just pressed is not recognized by SDL. To help get this
fixed, please report this to the SDL forums/mailing list
<https://discourse.libsdl.org/ > EVDEV KeyCode 330"
(EVDEV KeyCode 330 is BTN_TOUCH.)
Fixes Bugzilla #4147 .
2019-01-14 19:36:54 -05:00
Sylvain Becker
984e2734ff
Android: create Pause/ResumeSem semaphore at higher level than CreateWindow()
...
- If you call onPause() before CreateWindow(), SDLThread will run in infinite loop in background.
- If you call onPause() between a DestroyWindow() and a new CreateWindow(), semaphores are invalids.
SDLActivity.java: the first resume() starts the SDLThread, don't call
nativeResume() as it would post ResumeSem. And the first pause would
automatically be resumed.
2019-01-14 23:33:48 +01:00
Sylvain Becker
abf0a4a1b8
Android/openslES: fix Pause/ResumeDevices when openslES is not used
2019-01-14 22:56:57 +01:00
Sylvain Becker
afa59ae833
Android: minor, remove static attributes, move mIsSurfaceReady to SDLSurface
2019-01-14 21:34:12 +01:00
Sylvain Becker
7bfcc593ea
Android/openslES: check for non NULL variable, some intialization.
...
use the previous naming
2019-01-14 14:36:13 +01:00
Sylvain Becker
23ad908d94
Android/openslES: start playing, after creating ressources
2019-01-14 14:31:06 +01:00
Sylvain Becker
6590fe7d44
Android/openslES: set audio in paused/resumed state for Android event loop
...
And also in "stopped" state before closing the device.
2019-01-14 12:33:29 +01:00
Sylvain Becker
667f58bce4
Android/openslES: move a few static variables to SDL_PrivateAudioData structure
2019-01-14 10:58:57 +01:00
Sylvain Becker
880cc65039
Android/openslES: register and use CloseDevice function.
2019-01-14 10:16:26 +01:00
Sylvain Becker
dd6f71a357
Android/openslES: some space and indentation to match SDL conventions
2019-01-14 10:04:54 +01:00
Sam Lantinga
474f5bcf31
Initial Android OpenSL ES implementation, contributed by ANTA
2019-01-12 12:18:44 -08:00
Sam Lantinga
f06ffcc868
Fixed compiler warning
2019-01-12 12:12:43 -08:00
Sam Lantinga
95f81a2b13
Updated minimum supported Android version to API 16, to match latest NDK toolchain
2019-01-12 12:11:06 -08:00
Sylvain Becker
d4a6d42c36
Fixed bug 4453 - GLES / GLES2: first white renderer clear cmd is drawn as black
2019-01-12 13:34:03 +01:00
Sylvain Becker
e071b11a5d
Android: move and group JNIEnv helper functions
2019-01-11 21:52:43 +01:00
Sylvain Becker
3db3b74d26
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
2019-01-11 21:42:52 +01:00
Sylvain Becker
252f2ca2ec
Android: use the same naming for JNI env local variables
2019-01-11 15:36:16 +01:00
Sylvain Becker
232c33acef
Android: Audio thread is already setup for the JVM
...
In 'src/thread/pthread/SDL_systhread.c' RunThread() calls first 'Android_JNI_SetupThread()'
2019-01-11 15:33:02 +01:00
Sylvain Becker
7115483b1a
Android: use pthread_once for creating thread key 'mThreadKey'
2019-01-11 15:27:53 +01:00
Sylvain Becker
8ea33bec0f
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.
2019-01-11 14:50:43 +01:00
Sylvain Becker
74af914697
Android: fix bad merge from previous commit
2019-01-11 14:25:32 +01:00
Sylvain Becker
50cb107630
Android: fix prototype of Android_JNI_InitTouch
2019-01-10 21:49:00 +01:00
Sylvain Becker
7cab35335d
Android: add name for Touch devices and simplification, from bug 3958
2019-01-10 21:40:57 +01:00