A Minimal Application

These bits and pieces of GL code given in the buffer objects section form the basis of a minimal GL application. First, an HTML document defines the structure of the application and provides the GL Shading Language source.

prog.html ≡
 <html>
  <head>
   〈Headers〉
  </head>
  <body onload="init()">
    <script id="vertexShader" type="x-shader/x-vertex">
      〈Vertex Shader〉
    </script>
    <script id="fragmentShader" type="x-shader/x-fragment">
      〈Fragment Shader〉
    </script>
   〈Elements〉
  </body>
 </html>

Second, a JavaScript document describes the behavior of the application.

prog.js ≡
  〈Initialization〉
  〈Rendering〉