From d74779b7483d6692c247b30b15d97823096cfe02 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Thu, 4 Feb 2021 13:50:56 +0100 Subject: [PATCH] Android: documention update --- docs/README-android.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/README-android.md b/docs/README-android.md index fbd9f9906..4b7fefeed 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -205,10 +205,37 @@ app can continue to operate as it was. However, there's a chance (on older hardware, or on systems under heavy load), where the GL context can not be restored. In that case you have to listen for -a specific message, (which is not yet implemented!) and restore your textures -manually or quit the app (which is actually the kind of behaviour you'll see -under iOS, if the OS can not restore your GL context it will just kill your app) +a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures +manually or quit the app. +You should not use the SDL renderer API while the app going in background: +- SDL_APP_WILLENTERBACKGROUND: + after you read this message, GL context gets backed-up and you should not + use the SDL renderer API. + +- SDL_APP_DIDENTERFOREGROUND: + GL context is restored, and the SDL renderer API is available (unless you + receive SDL_RENDER_DEVICE_RESET). + +================================================================================ + Mouse / Touch events +================================================================================ + +In some case, SDL generates synthetic mouse (resp. touch) events for touch +(resp. mouse) devices. +To enable/disable this behavior, see SDL_hints.h: +- SDL_HINT_TOUCH_MOUSE_EVENTS +- SDL_HINT_MOUSE_TOUCH_EVENTS + +================================================================================ + Misc +================================================================================ + +For some device, it appears to works better setting explicitly GL attributes +before creating a window: + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); ================================================================================ Threads and the Java VM