uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

Text and Textures should be able to update OpenGL textures automatically #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When dotsDrawableText and dotsDrawableTextures objects change their appearance, 
they need to update OpenGL resources--their texture objects.  This usually 
happens during prepareToDrawInWindow().  This is nice because it allows slow 
operations like texture loading to happen before animation starts.

But it's also cumbersome to to call prepareToDrawInWindow.  So these classes 
should set a flag, perhaps isTextureStale, when relevant properties change.  
draw() can check the flag and update buffers (and clear the flag) if the flag 
is still set.  It would still be possible to do this beforehand with 
prepareToDrawInWindow().

This is worth including in Version 1.

Original issue reported on code.google.com by Benjamin.Heasly on 1 Mar 2012 at 6:08

GoogleCodeExporter commented 8 years ago
As of r925, dotsDrawableText and dotsDrawableTextures use a isTextureStale 
flag. It's true by default and whenever a relevant property changes.  draw() 
lazily invokes prepareToDrawInWindow(), if the flag is set.  
prepareToDrawInWindow() clears the flag.

This looks right in the demos.

Original comment by Benjamin.Heasly on 21 Mar 2012 at 3:15