changeset 894:f557b18d287f

wasm: error log if canvas GL context can't be created
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 16 Jul 2019 10:51:03 +0200
parents 0c5201499af8
children a8e3d686b43e
files Framework/OpenGL/WebAssemblyOpenGLContext.cpp Framework/Scene2DViewport/AngleMeasureTool.cpp Framework/Scene2DViewport/MeasureTool.h
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Mon Jul 15 12:48:19 2019 +0200
+++ b/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Tue Jul 16 10:51:03 2019 +0200
@@ -49,8 +49,10 @@
         context_ = emscripten_webgl_create_context(canvas.c_str(), &attr);
         if (context_ < 0)
         {
-          throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
-                                          "Cannot create an OpenGL context for canvas: " + canvas);
+          std::string message("Cannot create an OpenGL context for canvas: ");
+          message += canvas;
+          LOG(ERROR) << message;
+          throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, message);
         }
 
         UpdateSize();
--- a/Framework/Scene2DViewport/AngleMeasureTool.cpp	Mon Jul 15 12:48:19 2019 +0200
+++ b/Framework/Scene2DViewport/AngleMeasureTool.cpp	Tue Jul 16 10:51:03 2019 +0200
@@ -298,7 +298,7 @@
 
 #if 0
           // TODO:make it togglable
-          bool enableInfoDisplay = false;
+          bool enableInfoDisplay = true;
           if (enableInfoDisplay)
           {
             TrackerSample_SetInfoDisplayMessage("center_.GetX()",
--- a/Framework/Scene2DViewport/MeasureTool.h	Mon Jul 15 12:48:19 2019 +0200
+++ b/Framework/Scene2DViewport/MeasureTool.h	Tue Jul 16 10:51:03 2019 +0200
@@ -144,5 +144,5 @@
 
 }
 
-extern void TrackerSample_SetInfoDisplayMessage(
-  std::string key, std::string value);
+ //extern void TrackerSample_SetInfoDisplayMessage(
+ //  std::string key, std::string value);