diff Framework/OpenGL/WebAssemblyOpenGLContext.cpp @ 945:2db3ef713664 toa2019080601

Fixed error handling for WebGL context creation
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 06 Aug 2019 15:06:53 +0200
parents 685c9a2d115f
children 1091b2adeb5a
line wrap: on
line diff
--- a/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Mon Aug 05 12:28:38 2019 +0200
+++ b/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Tue Aug 06 15:06:53 2019 +0200
@@ -49,7 +49,7 @@
         emscripten_webgl_init_context_attributes(&attr);
 
         context_ = emscripten_webgl_create_context(canvas.c_str(), &attr);
-        if (context_ < 0)
+        if (context_ == 0)
         {
           std::string message("Cannot create an OpenGL context for canvas: ");
           message += canvas;