Web client: Show an alert if WebGL is unsupported instead of just immediately failing with obscure error

This commit is contained in:
UnknownShadow200 2020-11-08 21:00:18 +11:00
parent 0ae4600660
commit 6a8ca0ebd4

View File

@ -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);
}