Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Ash McConnell May 17 '11 at 19:22
    
Please add that as an answer and accept it so the question gets removed from the unanswered section. –  Martin Foot Aug 28 '11 at 16:59

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.