]> git.r.bdr.sh - rbdr/lissajous/blobdiff - lib/webgl_utils.js
Add a few comments
[rbdr/lissajous] / lib / webgl_utils.js
index 1386bf71bbbf18ce18303378a2f5234b207e0f35..b594050e57ddcdbc3b80fbc4b3bb1dced17a6578 100644 (file)
@@ -25,16 +25,19 @@ export function initializeShaderProgram(gl, vertexShaderSource, fragmentShaderSo
   */
 export function initializeBuffers(gl) {
 
-    const positionBuffer = gl.createBuffer();
+  const positionBuffer = gl.createBuffer();
 
-    gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+  gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
 
-    return {
-      position: positionBuffer
-    };
-  }
+  return {
+    position: positionBuffer
+  };
+}
 
 
+/**
+  * Loads and compiles a shader
+  */
 function loadShader(gl, type, source) {
 
   const shader = gl.createShader(type);