From a6df8658309f82c62e4507894e409b65a6470950 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 14 Jun 2023 11:58:41 +0100 Subject: nicer show_error --- fractiform.js | 5 +++-- index.html | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/fractiform.js b/fractiform.js index eac29a6..9575802 100644 --- a/fractiform.js +++ b/fractiform.js @@ -39,6 +39,7 @@ void main() { gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { show_error('Error linking shader program:\n' + gl.getProgramInfoLog(program)); + return; } vertex_buffer = gl.createBuffer(); @@ -92,6 +93,6 @@ function compile_shader(name, type, source) { } function show_error(error) { - // TODO: display error in browser - console.log(error); + document.getElementById('error-message').innerText = error; + document.getElementById('error-dialog').showModal(); } diff --git a/index.html b/index.html index 2c6dfd3..399671f 100644 --- a/index.html +++ b/index.html @@ -6,9 +6,10 @@ - - Your browser doesn't support <canvas>
This page won't work for you.
+ + +

+  
+ +
+
+ -- cgit v1.2.3