diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-23 18:32:27 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-23 18:33:50 -0800 |
commit | da0883114b1dceceff8a38deea1bb870fda40464 (patch) | |
tree | 2f66a362e1cc752743a99936f9a92f77f9a3a922 /progs/util | |
parent | a11750218fa43dcf0d45b960d52497f7700db2a7 (diff) |
shaderutil: Fix detection of shaders
Check for versions >= 2.0 (because some drivers return 3.0), and return
GL_FALSE if shaders are not detected.
Diffstat (limited to 'progs/util')
-rw-r--r-- | progs/util/shaderutil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 4db950016b..629b6f1d97 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -25,7 +25,11 @@ GLboolean ShadersSupported(void) { const char *version = (const char *) glGetString(GL_VERSION); - if (version[0] == '2' && version[1] == '.') { + + /* NVIDIA binary drivers will return "3.0.0", and they clearly support + * shaders. + */ + if (version[0] >= '2' && version[1] == '.') { return GL_TRUE; } else if (glutExtensionSupported("GL_ARB_vertex_shader") @@ -34,7 +38,7 @@ ShadersSupported(void) fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n"); return GL_TRUE; } - return GL_TRUE; + return GL_FALSE; } |