1
\$\begingroup\$

This is an odd one. When I press home and then restart my game I reload all my textures (checking glIsTexture on the id's first). If I do this once, all textures load as expected, but if I do it twice or more one of my textures doesn't load (the texture is white).

I have checked glGetError and there are no errors (assuming GLES10.glGetError() is the correct way to do this)

Do I need to do any tidying up when home is pressed? I currently call myGlView.onPause() and myGlView.onResume() when the onPause/Resume activity events are triggered. I was under the impression that's all that's needed. Is there anything else (perhaps non-openGL) that needs to be cleaned up? Perhaps I'm hitting a limit of some kind

I am also using the NDK for some physics and rendering functions if that is relevant, but all resources are loaded using java.

\$\endgroup\$
2
  • \$\begingroup\$ Found the problem. It was hidden in some legacy NDK code ported from the iOS version. Previously I was loading and unloading textures in the native code. In the destructor in question there was a glDeleteTextures call that was removing the texture. I'm not sure why it didn't cause a problem on the first reload, but it now works. \$\endgroup\$ May 17, 2011 at 19:22
  • \$\begingroup\$ Please add that as an answer and accept it so the question gets removed from the unanswered section. \$\endgroup\$ Aug 28, 2011 at 16:59

1 Answer 1

1
\$\begingroup\$

Found the problem. It was hidden in some legacy NDK code ported from the iOS version. Previously I was loading and unloading textures in the native code. In the destructor in question there was a glDeleteTextures call that was removing the texture. I'm not sure why it didn't cause a problem on the first reload, but it now works

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .