daPhyre/webgl-lessons — pull request #5 by greggman (2014-01-22 01:08:38+00:00)
Title: Fix all image to texture loading to not generate warnings

All images load asynchronously which means either you should
not start rendering until they are loaded or else you need
to put something in the textures so you can render immediately.

This patch initializes all textures to a 1x1 pixel blue texture.
When the image finishes loading the code replaces that contents
of that texture with the image. Until then it's free to render
with the one pixel texture

This gets rid of the rendering warnings from the browser in
the JavaScript console.