A lightweight WebGL boilerplate library, made in March, 2020 by 1egend
jsDelivr CDN: https://cdn.jsdelivr.net/gh/1e9end/Impact/main.js
<script src = "https://cdn.jsdelivr.net/gh/1e9end/Impact/main.js"></script>
// rest of code...
function initGL(string x)
Returns the WebGL context/environment in the canvas element with id=x.
function createShader(type, string source)
Creates and returns a type = gl.VERTEX_SHADER/gl.FRAGMENT_SHADER shader with the source text code in the non-js script with id=source
function createProgram(vts, fts)
Creates and returns a program with attached vertex and fragment shaders: vtx, ftx (gl.createShader)s
void resize(string canvas, float w, float h, bool sq)
Resizes the canvas with id=canvas. w, h are optional inputs. If omitted, w, h will be set to window.innerWidth, window.innerHeight. If sq = true, then it will resize the canvas to a square with side length min(w, h).
Copyright © 2020-2021 1egend (1e9end)
Licensed under the GPL-3.0 license, see LICENSE for details.