From 6a8ca0ebd487b351d0107b9e8d17a02034450fbe Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 8 Nov 2020 21:00:18 +1100 Subject: [PATCH] Web client: Show an alert if WebGL is unsupported instead of just immediately failing with obscure error --- src/Window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Window.c b/src/Window.c index 9e5f2c731..466e46d5b 100644 --- a/src/Window.c +++ b/src/Window.c @@ -4722,6 +4722,8 @@ void GLContext_Create(void) { attribs.antialias = false; ctx_handle = emscripten_webgl_create_context("#canvas", &attribs); + if (!ctx_handle) Window_ShowDialog("WebGL unsupported", "WebGL is required to run ClassiCube"); + emscripten_webgl_make_context_current(ctx_handle); emscripten_set_webglcontextlost_callback("#canvas", NULL, 0, GLContext_OnLost); }