added GL_VERSION_2_0

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@299 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
ikits 2004-09-28 20:25:51 +00:00
parent ba99386119
commit 63374ccd9c
3 changed files with 63 additions and 35 deletions

1
auto/core/GL_VERSION_2_0 Normal file
View File

@ -0,0 +1 @@
GL_VERSION_2_0

View File

@ -57,56 +57,77 @@ static
GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
{
const GLubyte* s;
GLuint i;
GLuint major, minor;
/* query opengl version */
s = glGetString(GL_VERSION);
if (!s) return GLEW_ERROR_NO_GL_VERSION;
i = _glewStrCLen(s, '.')+1;
if (s+i-1 == NULL || s+i == NULL || s[i] < '1')
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'))
{
return GLEW_ERROR_GL_VERSION_10_ONLY;
}
else
{
if (s[i] >= '5')
if (s[major] >= '2')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_TRUE;
GLEW_VERSION_1_5 = GL_TRUE;
GLEW_VERSION_2_0 = GL_TRUE;
}
if (s[i] == '4')
else
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_TRUE;
GLEW_VERSION_1_5 = GL_FALSE;
}
if (s[i] == '3')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_FALSE;
GLEW_VERSION_1_5 = GL_FALSE;
}
if (s[i] == '2')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_FALSE;
GLEW_VERSION_1_4 = GL_FALSE;
GLEW_VERSION_1_5 = GL_FALSE;
}
if (s[i] < '2')
{
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;
if (s[minor] >= '5')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_TRUE;
GLEW_VERSION_1_5 = GL_TRUE;
GLEW_VERSION_2_0 = GL_FALSE;
}
if (s[minor] == '4')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_TRUE;
GLEW_VERSION_1_5 = GL_FALSE;
GLEW_VERSION_2_0 = GL_FALSE;
}
if (s[minor] == '3')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_TRUE;
GLEW_VERSION_1_4 = GL_FALSE;
GLEW_VERSION_1_5 = GL_FALSE;
GLEW_VERSION_2_0 = GL_FALSE;
}
if (s[minor] == '2')
{
GLEW_VERSION_1_1 = GL_TRUE;
GLEW_VERSION_1_2 = GL_TRUE;
GLEW_VERSION_1_3 = GL_FALSE;
GLEW_VERSION_1_4 = GL_FALSE;
GLEW_VERSION_1_5 = GL_FALSE;
GLEW_VERSION_2_0 = GL_FALSE;
}
if (s[minor] < '2')
{
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;
}
}
}
/* initialize extensions */

View File

@ -1096,6 +1096,13 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
#endif /* GL_VERSION_1_1 */
#ifndef GL_VERSION_2_0
#define GL_VERSION_2_0 1
#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
#endif /* GL_VERSION_2_0 */
/* ---------------------------------- GLU ---------------------------------- */
/* this is where we can safely include GLU */
@ -1105,4 +1112,3 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
#include <GL/glu.h>
#endif