2005-01-03 07:05:38 +00:00
|
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
|
2004-02-01 22:27:31 +00:00
|
|
|
GLboolean glxewGetExtension (const char* name)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2004-02-01 18:13:05 +00:00
|
|
|
GLubyte* p;
|
|
|
|
GLubyte* end;
|
2004-02-01 22:27:31 +00:00
|
|
|
GLuint len = _glewStrLen((const GLubyte*)name);
|
2004-06-24 15:07:53 +00:00
|
|
|
/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */
|
|
|
|
/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */
|
|
|
|
if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE;
|
|
|
|
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
|
2003-07-06 15:01:13 +00:00
|
|
|
if (0 == p) return GL_FALSE;
|
|
|
|
end = p + _glewStrLen(p);
|
|
|
|
while (p < end)
|
|
|
|
{
|
2003-09-15 16:53:02 +00:00
|
|
|
GLuint n = _glewStrCLen(p, ' ');
|
2004-02-01 22:27:31 +00:00
|
|
|
if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
|
2003-07-06 15:01:13 +00:00
|
|
|
p += n+1;
|
|
|
|
}
|
|
|
|
return GL_FALSE;
|
|
|
|
}
|
|
|
|
|
2004-02-19 09:43:14 +00:00
|
|
|
GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
|
|
|
int major, minor;
|
|
|
|
/* initialize core GLX 1.2 */
|
2004-02-19 09:43:14 +00:00
|
|
|
if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
2004-02-19 04:37:07 +00:00
|
|
|
/* initialize flags */
|
2004-12-29 05:43:35 +00:00
|
|
|
GLXEW_VERSION_1_0 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_1 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_2 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_3 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_4 = GL_TRUE;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* query GLX version */
|
|
|
|
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
|
2004-12-29 05:43:35 +00:00
|
|
|
if (major == 1 && minor <= 3)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2004-12-29 05:43:35 +00:00
|
|
|
switch (minor)
|
|
|
|
{
|
|
|
|
case 3:
|
|
|
|
GLXEW_VERSION_1_4 = GL_FALSE;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
GLXEW_VERSION_1_4 = GL_FALSE;
|
|
|
|
GLXEW_VERSION_1_3 = GL_FALSE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
|
|
|
break;
|
|
|
|
}
|
2003-07-06 15:01:13 +00:00
|
|
|
}
|
|
|
|
/* initialize extensions */
|