Warren This sounds like a problem I was having a few months ago. It would be nice to have a little more detail on how you are setting up your rendering through AndroidGameView, but I will make a few assumptions and hopefully this information will be useful to you.
I am assuming that you have set up an AndroidGameView with a run loop that is started in the handler for an OnLoad event. You probably also have some kind of OO framework to handle initializing OpenGL textures (among other renderable objects) such that they can be drawn later in response to OnRenderFrame events without the need to reconstruct them each time. If this is at all similar to your approach, there are two issues you need to be aware of: 1. AndroidGameView maintains a Graphics context that is destroyed any time the view is paused. The graphics context maintains references to various resources such as textures, framebuffers, buffers, renderbuffers, shaders, and program contexts. *When the graphics context is destroyed the GPU will also destroy any resources associated with it.* This is normal behavior and is documented on the OpenTK site. So to handle this you will need to make sure that you have a way to signal a context change (do this upon your activity resuming) to your renderer so that it can remove any cached references to resources the GPU has deleted and then recreate them. 2. When the graphics context is destroyed in response to a screen rotation or when the device sleeps it is never recreated. I am assuming that there is a problem with the recreation of the SurfaceView because you never get another OnLoad event. This is apparently a known bug although I can't dig up a link at the moment. Unfortunately, I have not found a way around this problem that works consistently. I hope this helps. If not, give me a little more detail about your setup and I'll see what I can do. Chris -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Handling-texture-loss-in-OpenTK-on-mono-for-android-tp5045738p5050146.html Sent from the Mono for Android mailing list archive at Nabble.com. _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
