empaempa / GLOW

GLOW is a WebGL wrapper, which focuses on easy creation and use of shaders.
http://i-am-glow.com
MIT License
244 stars 28 forks source link

Added a loadCallback parameter for when the GLOW.Texture has loaded an image #16

Closed subblue closed 12 years ago

subblue commented 12 years ago

Useful for triggering a draw update on demand once a new image has loaded.

empaempa commented 12 years ago

Great idea! Would love to see it named just as in GLOW.Load, plus the extra (optional) context parameter. Something like...

{ ..., onLoadComplete: myCompleteHandler, onLoadContext: theContextOfMyCompleteHandlerWhichProbablyIsThis }

...and when calling...

if(this.scope.onLoadComplete) { this.scope.onLoadComplete.call( this.scope.onLoadContext, this.scope); }

Or what do you say? :)

subblue commented 12 years ago

Yes that makes sense, I'd forgotten about the GLOW.Load object! I've added a new commit (which GitHub seems to have magically included here...)

empaempa commented 12 years ago

Great! Thanks :)