From d4271fe56fc19b89b601c5c64ec34a9838403e8d Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 2 Apr 2015 15:58:40 +0300 Subject: [PATCH] 0026002: Visualization, TKOpenGl - detect alien Core Profile context Read GL_CONTEXT_PROFILE_MASK flags. Update of unstable test-case --- src/OpenGl/OpenGl_Context.cxx | 21 +++++++-------------- tests/sewing/tol_100/K1 | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index a798c3a212..fe233622e0 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -953,26 +953,19 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile) FindProc ("glGetStringi", myFuncs->glGetStringi); } - // this check would not work well due to buggy NVIDIA drivers! - /*GLint aProfile = 0; + bool isCoreProfile = false; if (IsGlGreaterEqual (3, 2)) { - ::glGetIntegerv (GL_CONTEXT_PROFILE_MASK, &aProfile); - } - const bool isCoreProfile = (aProfile & GL_CONTEXT_CORE_PROFILE_BIT) != 0;*/ + isCoreProfile = (theIsCoreProfile == Standard_True); - // detect Core profile - /*for (int anErr = glGetError(), aPrevErr = GL_NO_ERROR;; aPrevErr = anErr, anErr = glGetError()) - { - if (anErr == aPrevErr) + // detect Core profile + if (isCoreProfile) { - break; + GLint aProfile = 0; + ::glGetIntegerv (GL_CONTEXT_PROFILE_MASK, &aProfile); + isCoreProfile = (aProfile & GL_CONTEXT_CORE_PROFILE_BIT) != 0; } } - const char* anExtString = (const char* )::glGetString (GL_EXTENSIONS); - const bool isCoreProfile = IsGlGreaterEqual (3, 2) && (glGetError() != GL_NO_ERROR);*/ - - const bool isCoreProfile = IsGlGreaterEqual (3, 2) && theIsCoreProfile; #endif core11 = NULL; diff --git a/tests/sewing/tol_100/K1 b/tests/sewing/tol_100/K1 index 4f648fc780..e97bd65d25 100644 --- a/tests/sewing/tol_100/K1 +++ b/tests/sewing/tol_100/K1 @@ -1,4 +1,4 @@ -puts "TODO ?OCC23150 Windows: Error : Number of faults is" +puts "TODO ?OCC23150 ALL: Error : Number of faults is" puts "TODO OCC24592 ALL: Error : Number of free edges is" restore [locate_data_file CNP002_projoiep.rle] a