开发者

MonoTouch OpenGL app loses texture data when moved to background

开发者 https://www.devze.com 2023-02-05 20:26 出处:网络
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 filli

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:

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号