Wednesday, April 3, 2013

[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+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 and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment