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.

  <body onload="init()">
    <script id="vertexShader" type="x-shader/x-vertex">
      〈Vertex Shader〉
    <script id="fragmentShader" type="x-shader/x-fragment">
      〈Fragment Shader〉

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