The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Black screen on Android on some devices
kanigget


Joined: 08 Jun 2015
Posts: 2
Hi all,

I've got an Android/iOS game built using SDL 2.0.3 and on certain Android device/OS combinations, my users are reporting a black screen at startup (and nothing else). I've repro'ed the problem with Galaxy Tab S 8.4 with Android 5.0.2 (it doesn't happen on Android 4.4). The game runs just fine (eg. sounds play when you tap), but everything is black. The test apps (eg. testgles2.c) also exhibit the same problem on the same device/OS configuration so it's not just my app.

The problem doesn't seem to occur with the latest dev source of SDL and I've tracked it down to these lines:

https://hg.libsdl.org/SDL/file/704a0bfecf75/src/video/android/SDL_androidgl.c#l45
Code:

    /* FIXME: These two functions were in the Java code, do we really need them? */
    _this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
    _this->egl_data->eglWaitGL();


These were commented out in the latest source and when I do the same, there's no more black screen and my game works fine.

I'm happy to make this change and release an update to my app, but before I do I'd like to know - is it safe to make this change in isolation? Is it even reasonable that commenting out these lines fixes a bug like this? From my own very minimal understanding of GLES, these ought to do nothing but flush buffers.

By the way, my game uses the SDL 2d Renderer API, not GLES directly.

Finally, thanks heaps everyone for the SDL library, it has made my life as a cross-platform developer much easier!

cheers,
Steve.