简体   繁体   中英

MonoTouch OpenGL app loses texture data when moved to background

I have a MonoTouch OpenGL app that has a bunch of textures. When the user hits the iPhone button to move the app to the background, all my texture data seems to go away. I just see a solid color filling the triangles that I'm drawing with the textures that were loaded originally.

Any new textures that I load after resuming from the background state show up properly. It's just the textures that were loaded before the app was moved to the background that show up solid.

The docs state that "Your application should keep textures, models and other assets in memory" when it is moved to the background. I'm not doing anything to my textures, but something is forcing them out.

Any ideas?

My solution was to not use iPhoneOSGameView. That fixed all problems related to textures disappearing when my app went background. The code to manage the framebuffers and update timer yourself is pretty simple and I found the extra clarity (and working restore-from-background) to be worth the effort.

Not using iPhoneOSGameView also makes me feel better about the application's timer actually running at full speed when the app is active :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM