added check for crippled hardware

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@409 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
ikits 2005-03-17 01:45:46 +00:00
parent 8a9cb98efb
commit 782992e803

View File

@ -32,12 +32,24 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
{
const GLubyte* s;
GLuint major, minor;
/* check for SiS driver */
s = glGetString(GL_RENDERER);
if (s && _glewStrSame(s,"SiS",3))
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_FALSE;
GLEW_VERSION_1_3 = GL_FALSE;
GLEW_VERSION_1_4 = GL_FALSE;
GLEW_VERSION_1_5 = GL_FALSE;
GLEW_VERSION_2_0 = GL_FALSE;
}
else
{
/* query opengl version */
s = glGetString(GL_VERSION);
if (!s) return GLEW_ERROR_NO_GL_VERSION;
major = _glewStrCLen(s, '.')-1;
minor = _glewStrCLen(s, '.')+1;
if (s+major == NULL
|| s+minor-1 == NULL || s+minor == NULL
|| (s[major] == 1 && s[minor] < '1'))
@ -104,4 +116,5 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
}
}
}
}
/* initialize extensions */