title: Why WebGL 'clear' draw to front buffer?
body: <p>Why no need for swap-buffers or glFinish?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Game v.0.0&lt;/title&gt;
          &lt;script&gt;
              var gl = null;
              function startGame()
              {   {   var canvas = document.getElementById('gameCanvas');
                      var glNames = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"];
                      for (var glNameI = 0; glNameI &lt; glNames.length; ++glNameI)
                          try
                          {   gl = canvas.getContext(glNames[glNameI]);
                              if (gl) break;
                          }
                          catch(e)
                          {}
                      if(!gl)
                      {   canvas.outerHTML = "&lt;a&gt;WebGL NOT SUPPORTED? :(&lt;/a&gt;";
                          return;
                      }
                  }
  
                  window.onkeydown = function(ev)
                  {   switch(ev.keyCode)
                      {
                      case 49:// 1 key
                          gl.clearColor(0.3,0.7,0.2,1.0);
                          gl.clear(gl.COLOR_BUFFER_BIT); 
                          break;
                      case 50:// 2 key
                          gl.clearColor(0.3,0.2,0.7,1.0);
                          gl.clear(gl.COLOR_BUFFER_BIT); 
                          break;
                      }
                  };
              }
          &lt;/script&gt;
          &lt;style type="text/css"&gt;
              canvas {border: 2px dotted blue;}
          &lt;/style&gt;
      &lt;/head&gt;
  
      &lt;body onload="startGame()"&gt;
          &lt;div&gt;&lt;canvas id="gameCanvas" width="640" height="480"&gt;&lt;/canvas&gt;&lt;/div&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>