android - How to interrupt GLSurfaceView rendering phase and start a new one? -


hi android developers,

what best way interrupt current rendering phase of glsurfaceview , start new 1 when mode equal "render_when_dirty"? artificially stop rendering in "ondraw" method checking flag , returning actual rendering method called in "ondraw" method; then, in main thread's context call "requestrender()" refresh scene. however, due reason not aware of, of intermediary old frames displayed very short period of time(on other hand, endure long period of time users can realize transition); before actual scene rendered opengl es 2.x engine. doesn't affect @ all; troublesome fixed. suggest?

p.s. throwing interruptedexception within ondraw method useless due destruction of actual rendering thread of glsurfaveview.

kind regards.

when of old frames drawn - mean part of frame drawn old or multiple calls of ondraw() still lead of old information being shown on display.

there few things can see happening here. if have ondraw() this:

  ondrawframe(){   ... stuff ...   if (statevariableset)      return;   ... stuff ... 

my understanding when function done being run, back/front buffer swapped , drawn. 1 thing happening here see few calls of ondrawframe() being rendered while try update state/state variable.

on other hand, if have this:

   ondrawframe(){    ... stuff..    semaphore.acquire(); // lock thread waiting state update    ... stuff ... 

then things have been drawn before lock stale (for frame though - @ least that's i'd anticipate).

also running on multi-core system?


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -