0026002: Visualization, TKOpenGl - detect alien Core Profile context
authorkgv <kgv@opencascade.com>
Thu, 2 Apr 2015 12:58:40 +0000 (15:58 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 6 Apr 2015 14:25:12 +0000 (17:25 +0300)
Read GL_CONTEXT_PROFILE_MASK flags.

Update of unstable test-case

src/OpenGl/OpenGl_Context.cxx
tests/sewing/tol_100/K1

index a798c3a..fe23362 100644 (file)
@@ -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;
index 4f648fc..e97bd65 100644 (file)
@@ -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