[android-developers] Re: duplicate calls to onSurfaceChanged() weirdness (again)
Yes, I have the same problem. onSurfaceChanged() is being called twice. Em quinta-feira, 12 de abril de 2012 12h57min35s UTC-3, Latimerius escreveu: Hello, googling for the following problem got me a lot of hits where people ask or rant about this but no actual explanation so I figured I'll ask here, perhaps someone has an update on the problem. I'm using stock GLSurfaceView, only subclassed to get onTouchEvent(), the rest of it is standard. When coming back to my app (*not* starting it anew, that seems to work as expected) I get the following sequence of calls: onSurfaceCreated() onSurfaceChanged() onDrawFrame() onSurfaceChanged() onDrawFrame() onDrawFrame() onDrawFrame() ... The (by now standard ;-)) question is: why is onSurfaceChanged() called twice? The calls are identical as far as the callee can tell, the GL10 argument refers to the same GL10 instance, the width height are the same, too. The other question (might have been asked before, too, I haven't come across that if so) is: the single onDrawFrame() call which occurs between both onSurfaceChanged() calls is strange because whatever gets drawn during that call (might be just a simple glClear(), or a full scene render, doesn't matter) never seems to make it to the screen, never becomes visible. Why is that? I'm trying to figure out whether it's safe to ignore the issue or hack around it, and to decide that it'd be very helpful to understand the causes. Thanks in advance! -- -- 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+unsubscr...@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 and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: duplicate calls to onSurfaceChanged() weirdness (again)
What non-idempotent code would you have had in onSurfaceChanged()? I would expect it all to be idempotent. Thanks. On Friday, April 13, 2012 8:56:18 AM UTC-5, Latimerius wrote: Okay, if nobody has an answer or explanation, I will hope that moving non-idempotent code out of onSurfaceChanged() and ignoring the first onDrawFrame() is enough to work around this bug. On Thu, Apr 12, 2012 at 5:57 PM, Latimerius l4t1m...@googlemail.comjavascript: wrote: Hello, googling for the following problem got me a lot of hits where people ask or rant about this but no actual explanation so I figured I'll ask here, perhaps someone has an update on the problem. I'm using stock GLSurfaceView, only subclassed to get onTouchEvent(), the rest of it is standard. When coming back to my app (*not* starting it anew, that seems to work as expected) I get the following sequence of calls: onSurfaceCreated() onSurfaceChanged() onDrawFrame() onSurfaceChanged() onDrawFrame() onDrawFrame() onDrawFrame() ... The (by now standard ;-)) question is: why is onSurfaceChanged() called twice? The calls are identical as far as the callee can tell, the GL10 argument refers to the same GL10 instance, the width height are the same, too. The other question (might have been asked before, too, I haven't come across that if so) is: the single onDrawFrame() call which occurs between both onSurfaceChanged() calls is strange because whatever gets drawn during that call (might be just a simple glClear(), or a full scene render, doesn't matter) never seems to make it to the screen, never becomes visible. Why is that? I'm trying to figure out whether it's safe to ignore the issue or hack around it, and to decide that it'd be very helpful to understand the causes. Thanks in advance! -- -- 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+unsubscr...@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 and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: duplicate calls to onSurfaceChanged() weirdness (again)
Just ignore it if the parameter values are the same. If they are different then re-set your viewport. If all you are doing is setting the viewport then just do it twice. If you are doing anything else why? On Thursday, April 12, 2012 4:57:35 PM UTC+1, Latimerius wrote: Hello, googling for the following problem got me a lot of hits where people ask or rant about this but no actual explanation so I figured I'll ask here, perhaps someone has an update on the problem. I'm using stock GLSurfaceView, only subclassed to get onTouchEvent(), the rest of it is standard. When coming back to my app (*not* starting it anew, that seems to work as expected) I get the following sequence of calls: onSurfaceCreated() onSurfaceChanged() onDrawFrame() onSurfaceChanged() onDrawFrame() onDrawFrame() onDrawFrame() ... The (by now standard ;-)) question is: why is onSurfaceChanged() called twice? The calls are identical as far as the callee can tell, the GL10 argument refers to the same GL10 instance, the width height are the same, too. The other question (might have been asked before, too, I haven't come across that if so) is: the single onDrawFrame() call which occurs between both onSurfaceChanged() calls is strange because whatever gets drawn during that call (might be just a simple glClear(), or a full scene render, doesn't matter) never seems to make it to the screen, never becomes visible. Why is that? I'm trying to figure out whether it's safe to ignore the issue or hack around it, and to decide that it'd be very helpful to understand the causes. Thanks in advance! -- -- 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+unsubscr...@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 and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: duplicate calls to onSurfaceChanged() weirdness (again)
Okay, if nobody has an answer or explanation, I will hope that moving non-idempotent code out of onSurfaceChanged() and ignoring the first onDrawFrame() is enough to work around this bug. On Thu, Apr 12, 2012 at 5:57 PM, Latimerius l4t1m3r...@googlemail.com wrote: Hello, googling for the following problem got me a lot of hits where people ask or rant about this but no actual explanation so I figured I'll ask here, perhaps someone has an update on the problem. I'm using stock GLSurfaceView, only subclassed to get onTouchEvent(), the rest of it is standard. When coming back to my app (*not* starting it anew, that seems to work as expected) I get the following sequence of calls: onSurfaceCreated() onSurfaceChanged() onDrawFrame() onSurfaceChanged() onDrawFrame() onDrawFrame() onDrawFrame() ... The (by now standard ;-)) question is: why is onSurfaceChanged() called twice? The calls are identical as far as the callee can tell, the GL10 argument refers to the same GL10 instance, the width height are the same, too. The other question (might have been asked before, too, I haven't come across that if so) is: the single onDrawFrame() call which occurs between both onSurfaceChanged() calls is strange because whatever gets drawn during that call (might be just a simple glClear(), or a full scene render, doesn't matter) never seems to make it to the screen, never becomes visible. Why is that? I'm trying to figure out whether it's safe to ignore the issue or hack around it, and to decide that it'd be very helpful to understand the causes. Thanks in advance! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en