diff options
author | Corbin Simpson <mostawesomedude@gmail.com> | 2008-08-16 11:07:51 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-16 11:07:51 -0600 |
commit | 567d87744ab7b7c2564ce3ba9969caff214e3334 (patch) | |
tree | a6688ddf032d547b84c0c7a451cab7c4acb7d133 | |
parent | 5d762e16139a9ec5bb33788d9d7f0f0853bf1091 (diff) |
added test for ARB GLSL extensions
-rw-r--r-- | progs/util/shaderutil.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 477209ab45..4f17dd7efa 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -27,12 +27,15 @@ Init(void) GLboolean ShadersSupported(void) { - const char *version; - - version = (const char *) glGetString(GL_VERSION); - if (version[0] != '2' || version[1] != '.') { - printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - return GL_FALSE; + const char *version = (const char *) glGetString(GL_VERSION); + if (version[0] == '2' && version[1] == '.') { + return GL_TRUE; + } + else if (glutExtensionSupported("GL_ARB_vertex_shader") + && glutExtensionSupported("GL_ARB_fragment_shader") + && glutExtensionSupported("GL_ARB_shader_objects")) { + fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n"); + return GL_TRUE; } return GL_TRUE; } |