added error message when GL shaders are not available

This commit is contained in:
Luke Campagnola 2013-07-13 16:06:48 -04:00
parent 46901ae83a
commit 6131427dea

View File

@ -1,3 +1,4 @@
import OpenGL
from OpenGL.GL import *
from OpenGL.GL import shaders
import re
@ -218,6 +219,8 @@ class Shader(object):
if self.compiled is None:
try:
self.compiled = shaders.compileShader(self.code, self.shaderType)
except OpenGL.NullFunctionError:
raise Exception("This OpenGL implementation does not support shader programs; many features on pyqtgraph will not work.")
except RuntimeError as exc:
## Format compile errors a bit more nicely
if len(exc.args) == 3: