I’m using SDL 2.0.5 and the Android project template to port an existing SDL2 game to Android.
I’m seeing a problem when using the software renderer on Android. When the surface changes (eg. due to rotating portrait to landscape, or locking + unlocking the screen), the screen goes black and nothing I do recovers the image. The issue does not occur if I use a different renderer (eg. opengles or opengles2). I can tell from debug logging that the game is still running + rendering in the background, but I just can’t see anything on screen. I’ve tried doing an SDL_RenderClear() with a red background to make it obvious where the surface is, but again I see nothing but black after rotating the device or locking/unlocking the screen. I’ve tried tracing through the SDL software renderer code to see if any errors are being generated, but nothing seems to jump out at me.
Is this a known issue, and is there a workaround? I’ve taken a look in Mercurial for any Android-related fixes since 2.0.5 but there doesn’t seem to be anything there. I also couldn’t find any mention of this issue online.
Thanks for your help,