diff --git a/generators/work.html.template b/generators/work.html.template index 7991358..1ee26a8 100644 --- a/generators/work.html.template +++ b/generators/work.html.template @@ -8,6 +8,13 @@ padding: 0; overflow: hidden; background-color: black; + color: white; + } + main { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; } diff --git a/html/001-platform-provenance.html b/html/001-platform-provenance.html index 5c7b817..dc4b33a 100644 --- a/html/001-platform-provenance.html +++ b/html/001-platform-provenance.html @@ -8,6 +8,13 @@ padding: 0; overflow: hidden; background-color: black; + color: white; + } + main { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; } diff --git a/html/001-platform-provenance.js b/html/001-platform-provenance.js index 805c9e9..a4b9645 100644 --- a/html/001-platform-provenance.js +++ b/html/001-platform-provenance.js @@ -3,7 +3,7 @@ import { Shader } from "./lib/shader.js"; import { BasicPlane } from "./lib/basic-plane.js"; main((gl, core) => { - const shader = new Shader(gl) + const shader = new Shader(gl, core) .attach( gl.VERTEX_SHADER, ` diff --git a/html/lib/platform.js b/html/lib/platform.js index aaf0d48..29843b3 100644 --- a/html/lib/platform.js +++ b/html/lib/platform.js @@ -11,9 +11,9 @@ export const main = (next) => { // Only continue if WebGL is available and working if (gl === null) { - alert( - "Unable to initialize WebGL. Your browser or machine may not support it." - ); + document.querySelector( + "main" + ).innerHTML = `
your browser didn't let me set up webgl
`; return; } diff --git a/html/lib/shader.js b/html/lib/shader.js index 0b945f5..f92e07b 100644 --- a/html/lib/shader.js +++ b/html/lib/shader.js @@ -1,6 +1,7 @@ export class Shader { - constructor(gl) { + constructor(gl, core) { this.gl = gl; + this.core = core; this.program = gl.createProgram(); this.startTime = Date.now(); }