Skip to content
Snippets Groups Projects
Commit b2683da2 authored by Martin Schultz's avatar Martin Schultz
Browse files

added openGLVersion check as a silent operation, to avoid console

spamming when version check fails
parent a74dd588
No related branches found
No related tags found
1 merge request!88Feature picking shader compatibility
......@@ -126,7 +126,7 @@ bool checkExtensionSupported( const std::string& _extension ) {
/** Check if OpenGL Version is greater or equal than the given values
*/
bool openGLVersion( const int _major, const int _minor ) {
bool openGLVersion( const int _major, const int _minor, bool _verbose ) {
// Read OpenGL Version string
std::string glVersionString = (const char*)glGetString(GL_VERSION);
......@@ -148,8 +148,11 @@ bool openGLVersion( const int _major, const int _minor ) {
stream >> minor;
if ( (_major > major) || ( (_major == major) && (_minor > minor)) ) {
if(_verbose)
{
std::cerr << "OpenGL Version check failed. Required : " << _major << "." << _minor << std::endl;
std::cerr << "OpenGL Version check failed. Available : " << major << "." << minor << std::endl;
}
return false;
}
......
......@@ -269,7 +269,12 @@ bool ACGDLLEXPORT checkExtensionSupported( const std::string& _extension ) ;
/** Check if OpenGL Version is greater or equal than the given values
*/
bool ACGDLLEXPORT openGLVersion( const int _major, const int _minor );
bool ACGDLLEXPORT openGLVersion( const int _major, const int _minor, bool verbose = true );
/** Test if OpenGL Version is greater or equal than the given values
* No output is generated, if the OpenGL version is less than the tested value
*/
inline bool ACGDLLEXPORT openGLVersionTest( const int _major, const int _minor ){return openGLVersion(_major, _minor, false);}
/// Store opengl core profile setting
void ACGDLLEXPORT compatibilityProfile(bool _compatProfile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment