comparison Framework/OpenGL/WebAssemblyOpenGLContext.cpp @ 1483:6abd819aa534

moving edge case from WebGLViewport::UpdateSize() to WebAssemblyOpenGLContext::RefreshCanvasSize()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 20 Jun 2020 11:16:55 +0200
parents 5c96bf3f1d32
children
comparison
equal deleted inserted replaced
1482:5c96bf3f1d32 1483:6abd819aa534
241 } 241 }
242 242
243 void WebAssemblyOpenGLContext::RefreshCanvasSize() 243 void WebAssemblyOpenGLContext::RefreshCanvasSize()
244 { 244 {
245 assert(pimpl_.get() != NULL); 245 assert(pimpl_.get() != NULL);
246 pimpl_->UpdateSize(); 246
247 try
248 {
249 pimpl_->UpdateSize();
250 }
251 catch (const StoneException& e)
252 {
253 // Ignore problems about the loss of the WebGL context (edge case)
254 if (e.GetErrorCode() == ErrorCode_WebGLContextLost)
255 {
256 return;
257 }
258 else
259 {
260 throw;
261 }
262 }
247 } 263 }
248 264
249 const std::string& WebAssemblyOpenGLContext::GetCanvasSelector() const 265 const std::string& WebAssemblyOpenGLContext::GetCanvasSelector() const
250 { 266 {
251 assert(pimpl_.get() != NULL); 267 assert(pimpl_.get() != NULL);