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
Testing OpenGL context loss on Android
Preet
Guest

According to the docs (README-android in the SDL source/docs):

"Upon resume, SDL will attempt to restore the GL context automatically.
In modern devices (Android 3.0 and up) this will most likely succeed and your
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 the latest version of SDL (from source), the SDL_RENDER_DEVICE_RESET event is sent out when the context cannot be restored. However in normal usage of a test application, I never receive this signal (I tried hiding the backgrounding, turning off the display etc). I guess my device is new enough to avoid scrapping the GL context often.


But I want to ensure my application can handle that event when it happens. Is there any way I can force a context loss to actually test for that case?