Triangle demo:
The "Hello World" of WebGL, I guess. Key concepts:
- Get WebGL context from a HTML canvas element (in initWebGL())
- Load vertex and fragment shader GLSL source code as strings (in loadAssets())
- Compile shaders (in createShaders()) and then link the shaders into a program (in createProgram())
- Create a simple model with three vertices
- Create an array buffer for the vertices (in initArrayBuffer())
- Draw the triangle (in drawScene())