diff options
Diffstat (limited to 'silx/gui/_glutils')
-rw-r--r-- | silx/gui/_glutils/OpenGLWidget.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/silx/gui/_glutils/OpenGLWidget.py b/silx/gui/_glutils/OpenGLWidget.py index 7f600a0..c5ece9c 100644 --- a/silx/gui/_glutils/OpenGLWidget.py +++ b/silx/gui/_glutils/OpenGLWidget.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2017 European Synchrotron Radiation Facility +# Copyright (c) 2017-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,7 @@ across Qt<=5.3 QtOpenGL.QGLWidget and QOpenGLWidget. __authors__ = ["T. Vincent"] __license__ = "MIT" -__date__ = "26/07/2017" +__date__ = "22/11/2019" import logging @@ -192,7 +192,12 @@ else: # Check OpenGL version if self.getOpenGLVersion() >= self.getRequestedOpenGLVersion(): - version = gl.glGetString(gl.GL_VERSION) + try: + gl.glGetError() # clear any previous error (if any) + version = gl.glGetString(gl.GL_VERSION) + except: + version = None + if version: self.__isValid = True else: |