Monday, January 28, 2013

[android-developers] Re: pause breaks...

As soon as your OpenGL context changes you'll need to reload all textures.
The Renderer.onSurfaceCreated method has a very good explanation of what's going on under the hood and what is required from you:

Called when the surface is created or recreated.

Called when the rendering thread starts and whenever the EGL context is lost. The EGL context will typically be lost when the Android device awakes after going to sleep.

Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be recreated when the EGL context is lost. Textures are an example of a resource that you might want to create here.



On Monday, January 28, 2013 2:35:23 PM UTC-6, bob wrote:

So, let's say I have my app running.


Then I close the magnetic case.


Then, I wait one second.


Then, I open the case.


So, my understanding is that onPause gets called upon closing the case.


Then onResume gets called upon opening the case.


The confusing part is that some of the stuff in the old program is valid, and some isn't.


I guess I have to re-load all OpenGL textures for one thing?


Is there an easy rule of thumb to know what is valid and what isn't after an onPause/onResume?


Thanks.


--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment