text: // This is where the entrypoint is
  main();
  
  // Mozilla's tutorial on WebGL was used as a base for this example.
  // See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial
  // The original source is here: https://github.com/mdn/webgl-examples
  
  function main() {
  
      console.log("Setting up the canvas");
  
      // Find the canavas tag in the HTML document
      const canvas = document.querySelector("#exampleCanvas");
  
      // Initialize the WebGL2 context
      // The `gl` variable represents the context for which we access WebGL.
      // By calling it `gl`, the calls are similar in syntax to the OpenGL ES API.
      const gl = canvas.getContext("webgl2");
  
      // Only continue if WebGL2 is available and working
      if (gl === null) {
          printError('WebGL 2 not supported by your browser',
              'Check to see you are using a <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API#WebGL_2_2" class="alert-link">modern browser</a>.');
          return;
      }
  
      console.log("Starting rendering loop");
  
      // A variable for keeping track of time between frames
      var then = 0.0;
  
      // This function is called when we want to render a frame to the canvas
      function render(now) {
          now *= 0.001; // convert to seconds
          const deltaTime = now - then;
          then = now;
  
          // Draw our scene
          drawScene(gl, deltaTime);
  
          // Request another frame when this one is done
          requestAnimationFrame(render);
      }
  
      // Draw the scene
      requestAnimationFrame(render);
  }
  
  
  /**
   * Draws the scene. Should be called every frame
   * 
   * @param  {} gl WebGL2 context
   * @param {number} deltaTime Time between each rendering call
   */
  function drawScene(gl, deltaTime) {
      // Set clear colour
      // This is a Red-Green-Blue-Alpha colour
      // See https://en.wikipedia.org/wiki/RGB_color_model
      // Here we use floating point values. In other places you may see byte representation (0-255).
      gl.clearColor(0.55686, 0.54902, 0.52157, 1.0);
  
      // Depth testing allows WebGL to figure out what order to draw our objects such that the look natural.
      // We want to draw far objects first, and then draw nearer objects on top of those to obscure them.
      // To determine the order to draw, WebGL can test the Z value of the objects.
      // The z-axis goes out of the screen
      gl.enable(gl.DEPTH_TEST); // Enable depth testing
      gl.depthFunc(gl.LEQUAL); // Near things obscure far things
      gl.clearDepth(1.0); // Clear everything
  
      // Clear the color and depth buffer with specified clear colour.
      // This will replace everything that was in the previous frame with the clear colour.
      gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
  }