comparison Framework/Scene2D/Internals/OpenGLLinesProgram.cpp @ 956:a7351ad54960

Made IsContextLost automatically set the flag by checking with the emscripten WebGL wrapper + added a LOT of logging messages right before throwing ErrorCode_BadSequenceOfCalls exceptions + increased the http request timeouts from 60 to 600 sec (big datasets in some recent customer use cases) + added IsContext lost through the Viewport/Context layer (to make it reachable from external API) + the same for the underlying device context (for debug)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 21 Aug 2019 16:16:30 +0200
parents 1091b2adeb5a
children 2d8ab34c8c91
comparison
equal deleted inserted replaced
953:118fc5c85d07 956:a7351ad54960
205 std::vector<float>& colors, 205 std::vector<float>& colors,
206 const Color& color) 206 const Color& color)
207 { 207 {
208 if (isEmpty_) 208 if (isEmpty_)
209 { 209 {
210 LOG(ERROR) << "OpenGLLinesProgram -- AddTriangles: (isEmpty_)";
210 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 211 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
211 } 212 }
212 213
213 // First triangle 214 // First triangle
214 coords.push_back(static_cast<float>(x1_)); 215 coords.push_back(static_cast<float>(x1_));
361 362
362 GLuint OpenGLLinesProgram::Data::GetVerticesBuffer() const 363 GLuint OpenGLLinesProgram::Data::GetVerticesBuffer() const
363 { 364 {
364 if (IsEmpty()) 365 if (IsEmpty())
365 { 366 {
367 LOG(ERROR) << "OpenGLLinesProgram::Data::GetVerticesBuffer(): (IsEmpty())";
366 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 368 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
367 } 369 }
368 else 370 else
369 { 371 {
370 return buffers_[0]; 372 return buffers_[0];
374 376
375 GLuint OpenGLLinesProgram::Data::GetMiterDirectionsBuffer() const 377 GLuint OpenGLLinesProgram::Data::GetMiterDirectionsBuffer() const
376 { 378 {
377 if (IsEmpty()) 379 if (IsEmpty())
378 { 380 {
381 LOG(ERROR) << "OpenGLLinesProgram::Data::GetMiterDirectionsBuffer(): (IsEmpty())";
379 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 382 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
380 } 383 }
381 else 384 else
382 { 385 {
383 return buffers_[1]; 386 return buffers_[1];
387 390
388 GLuint OpenGLLinesProgram::Data::GetColorsBuffer() const 391 GLuint OpenGLLinesProgram::Data::GetColorsBuffer() const
389 { 392 {
390 if (IsEmpty()) 393 if (IsEmpty())
391 { 394 {
395 LOG(ERROR) << "OpenGLLinesProgram::Data::GetColorsBuffer(): (IsEmpty())";
392 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 396 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
393 } 397 }
394 else 398 else
395 { 399 {
396 return buffers_[2]; 400 return buffers_[2];