SDL 2.0 / Android pause/resume problems (black screen)

I am aware that on Android, when your app gets paused (e.g. by the user hitting the home key), the app’s OpenGL context gets lost.

I’ve seen vague statements that your app must recreate its textures etc. However, can anybody shed any light on what exactly is lost on a pause, and what needs to be done on resume?

My game (written in C, using OpenGL ES 2.0), has some textures and shaders. After a resume, glIsTexture(tex), glIsShader(shader), glIsProgram(program) all return TRUE for my textures and shaders.

For my textures, I recreate them by calling glTexImage2D() using pixel data kept from when the texture was originally loaded.

For my shaders, I rebuild and relink them.

Is there anything else that I need to do to recreate my OpenGL context?

As things are, after a resume, my app just displays a black screen. It is still running, as it logs various things when I touch the screen, but nothing is displayed.

Any help would be greatly appreciated! Or if anybody has (or can point to) example code that implements resume properly.

Thanks,
Philip.

2012/8/9 pmacfarlane

**
I am aware that on Android, when your app gets paused (e.g. by the user
hitting the home key), the app’s OpenGL context gets lost.

This should no longer be the case on the current version of SDL2, what
device / Android version is giving you that problem?–
Gabriel.