1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0027715: Visualization - turn off deprecated OpenGL fixed-function pipeline by default

OpenGl_Caps - flag ffpEnable is now initialized to false on desktop OpenGL.
OpenGl_Context::init() - now prints error if OpenGL version does not support GLSL
and switches OpenGl_Caps::ffpEnable to true.

update test cases
This commit is contained in:
kgv
2016-07-26 22:08:39 +03:00
committed by bugmaster
parent 66cce03ae5
commit be3752526f
24 changed files with 57 additions and 111 deletions

View File

@@ -29,7 +29,7 @@ OpenGl_Caps::OpenGl_Caps()
pntSpritesDisable (Standard_False),
keepArrayData (Standard_False),
#if !defined(GL_ES_VERSION_2_0)
ffpEnable (Standard_True),
ffpEnable (Standard_False),
useSystemBuffer (Standard_False),
#else
ffpEnable (Standard_False),

View File

@@ -1055,6 +1055,20 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
myMaxMsaaSamples = 0;
ReadGlVersion (myGlVerMajor, myGlVerMinor);
myVendor = (const char* )::glGetString (GL_VENDOR);
if (!caps->ffpEnable
&& !IsGlGreaterEqual (2, 0))
{
caps->ffpEnable = true;
TCollection_ExtendedString aMsg =
TCollection_ExtendedString("OpenGL driver is too old! Context info:\n")
+ " Vendor: " + (const char* )::glGetString (GL_VENDOR) + "\n"
+ " Renderer: " + (const char* )::glGetString (GL_RENDERER) + "\n"
+ " Version: " + (const char* )::glGetString (GL_VERSION) + "\n"
+ " Fallback using deprecated fixed-function pipeline.\n"
+ " Visualization might work incorrectly.\n"
" Consider upgrading the graphics driver.";
PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_PORTABILITY, 0, GL_DEBUG_SEVERITY_HIGH, aMsg);
}
#if defined(GL_ES_VERSION_2_0)
(void )theIsCoreProfile;