<commit_before>/**
 * glTips - Useful, cherry-pickable, and CC0 (Public Domain like) licensed WebGL Routine Code Snippets.
 *
 * These codes are licensed under CC0.
 * http://creativecommons.org/publicdomain/zero/1.0/deed.ja
 */

(function(global) {
  "use strict";
// Class ------------------------------------------------
  function glTips() {

    // Globalization ----------------------------------------
    for(var key in glTips){
      global[key] = glTips[key];
    }
  }


// Header -----------------------------------------------

  glTips.getWebGL1Context = glTips_getWebGL1Context; // glTips#getWebGL1Context(canvas:HTMLCanvasElement):WebGLRenderingContext
  glTips.getWebGL2Context = glTips_getWebGL2Context; // glTips#getWebGL2Context(canvas:HTMLCanvasElement):WebGL2RenderingContext
  glTips.compileShader = glTips_compileShader; // glTips#compileShader(gl:WebGLRenderingContext, shaderType:[gl.VERTEX_SHADER|gl.FRAGMENT_SHADER], shaderText:string):WebGLShader
  glTips.setupShaderProgram = glTips_setupShaderProgram; // glTips#setupShaderProgram(gl:WebGLRenderingContext, vertexShader:WebGLShader, fragmentShader:WebGLShader):WebGLShaderProgram
  glTips.setupShaderProgramFromSource = glTips_setupShaderProgramFromSource; // glTips#setupShaderProgramFromSource(gl, vertexShaderText:string, fragmentShaderText:string):WebGLShaderProgram
  glTips.setupTexture2D = glTips_setupTexture2D;// glTips#setupTexture2D(gl:WebGLRenderingContext, srcUri:string, level:number, internalFormat:number, format:number, type:number, magFileter:number, minFilter:number, wrapS:number, wrapT:number, mipmap:boolean, flipY:boolean, callback:Function)
  glTips.setupTexture2DSimple = glTips_setupTexture2DSimple; // glTips#setupTexture2DSimple(gl:WebGLRenderingContext, srcUri, internalFormat, format, type, filter, wrap, flipY, callback)
  glTips.makeVerticesDataInterleaved = glTips_makeVerticesDataInterleaved; // glTips#makeVerticesDataInterleaved(gl:WebGLRenderingContext, type:number, arrayOfAttributeDataArray:Array, componentArray:Array):TypedArray
// Implementation ---------------------------------------

  /**
   * Create a WebGL1 context.
   *
   * @param {HTMLCanvasElement} canvas. The canvas element.
   * @return {WebGLRenderingContext} The created context.
   * @memberOf module:glTips
   */
  function glTips_getWebGL1Context(canvas) {
    var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");

    if (!gl) {
       throw new Error("WebGL1 not supported");
    }

    if (!(gl instanceof WebGLRenderingContext)) {
       throw new Error("unexpected rendering context.");
    }<commit_msg>Remove WebGLRenderingContext check to support WebGL Inspector extension.<commit_after>/**
 * glTips - Useful, cherry-pickable, and CC0 (Public Domain like) licensed WebGL Routine Code Snippets.
 *
 * These codes are licensed under CC0.
 * http://creativecommons.org/publicdomain/zero/1.0/deed.ja
 */

(function(global) {
  "use strict";
// Class ------------------------------------------------
  function glTips() {

    // Globalization ----------------------------------------
    for(var key in glTips){
      global[key] = glTips[key];
    }
  }


// Header -----------------------------------------------

  glTips.getWebGL1Context = glTips_getWebGL1Context; // glTips#getWebGL1Context(canvas:HTMLCanvasElement):WebGLRenderingContext
  glTips.getWebGL2Context = glTips_getWebGL2Context; // glTips#getWebGL2Context(canvas:HTMLCanvasElement):WebGL2RenderingContext
  glTips.compileShader = glTips_compileShader; // glTips#compileShader(gl:WebGLRenderingContext, shaderType:[gl.VERTEX_SHADER|gl.FRAGMENT_SHADER], shaderText:string):WebGLShader
  glTips.setupShaderProgram = glTips_setupShaderProgram; // glTips#setupShaderProgram(gl:WebGLRenderingContext, vertexShader:WebGLShader, fragmentShader:WebGLShader):WebGLShaderProgram
  glTips.setupShaderProgramFromSource = glTips_setupShaderProgramFromSource; // glTips#setupShaderProgramFromSource(gl, vertexShaderText:string, fragmentShaderText:string):WebGLShaderProgram
  glTips.setupTexture2D = glTips_setupTexture2D;// glTips#setupTexture2D(gl:WebGLRenderingContext, srcUri:string, level:number, internalFormat:number, format:number, type:number, magFileter:number, minFilter:number, wrapS:number, wrapT:number, mipmap:boolean, flipY:boolean, callback:Function)
  glTips.setupTexture2DSimple = glTips_setupTexture2DSimple; // glTips#setupTexture2DSimple(gl:WebGLRenderingContext, srcUri, internalFormat, format, type, filter, wrap, flipY, callback)
  glTips.makeVerticesDataInterleaved = glTips_makeVerticesDataInterleaved; // glTips#makeVerticesDataInterleaved(gl:WebGLRenderingContext, type:number, arrayOfAttributeDataArray:Array, componentArray:Array):TypedArray
// Implementation ---------------------------------------

  /**
   * Create a WebGL1 context.
   *
   * @param {HTMLCanvasElement} canvas. The canvas element.
   * @return {WebGLRenderingContext} The created context.
   * @memberOf module:glTips
   */
  function glTips_getWebGL1Context(canvas) {
    var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");

    if (!gl) {
       throw new Error("WebGL1 not supported");
    }

{'fraction_non_alphanumeric': 0.16224529027297194, 'fraction_numerical': 0.007689350249903883, 'mean_word_length': 4.121062992125984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2159551', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1537, 'n_words': 254}