added test for ARB GLSL extensions

This commit is contained in:
Corbin Simpson
2008-08-16 11:07:51 -06:00
committed by Brian Paul
parent 5d762e1613
commit 567d87744a

View File

@@ -27,12 +27,15 @@ Init(void)
GLboolean GLboolean
ShadersSupported(void) ShadersSupported(void)
{ {
const char *version; const char *version = (const char *) glGetString(GL_VERSION);
if (version[0] == '2' && version[1] == '.') {
version = (const char *) glGetString(GL_VERSION); return GL_TRUE;
if (version[0] != '2' || version[1] != '.') { }
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); else if (glutExtensionSupported("GL_ARB_vertex_shader")
return GL_FALSE; && 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; return GL_TRUE;
} }