Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
944:8b9bc91eda6b | 945:2db3ef713664 |
---|---|
47 // Context configuration | 47 // Context configuration |
48 EmscriptenWebGLContextAttributes attr; | 48 EmscriptenWebGLContextAttributes attr; |
49 emscripten_webgl_init_context_attributes(&attr); | 49 emscripten_webgl_init_context_attributes(&attr); |
50 | 50 |
51 context_ = emscripten_webgl_create_context(canvas.c_str(), &attr); | 51 context_ = emscripten_webgl_create_context(canvas.c_str(), &attr); |
52 if (context_ < 0) | 52 if (context_ == 0) |
53 { | 53 { |
54 std::string message("Cannot create an OpenGL context for canvas: "); | 54 std::string message("Cannot create an OpenGL context for canvas: "); |
55 message += canvas; | 55 message += canvas; |
56 LOG(ERROR) << message; | 56 LOG(ERROR) << message; |
57 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, message); | 57 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, message); |