From 69eac20a04b70823256125b85143a37e7ba639e7 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Thu, 23 Apr 2020 15:43:03 -0700 Subject: [PATCH] fix BX_TRACE in glcontext_html5.cpp (#2111) --- src/glcontext_html5.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index 1d1fe83d0..63b2f38fc 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -119,8 +119,9 @@ namespace bgfx { namespace gl s_attrs.minorVersion = 0; const char* canvas = (const char*) _nwh; + int error = 0; - for(int version = 2; version >= 1; --version) + for (int version = 2; version >= 1; --version) { s_attrs.majorVersion = version; EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(canvas, &s_attrs); @@ -134,8 +135,9 @@ namespace bgfx { namespace gl return swapChain; } + error = (int) context; } - BX_TRACE("Failed to create WebGL context. (Canvas handle: '%s', error %d)", canvas, (int)context); + BX_TRACE("Failed to create WebGL context. (Canvas handle: '%s', last attempt error %d)", canvas, error); return NULL; }