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
|
|
|
{
|
2011-03-30 16:38:25 +00:00
|
|
|
const GLubyte* start;
|
|
|
|
const GLubyte* end;
|
2009-03-23 18:43:36 +00:00
|
|
|
|
|
|
|
if (glXGetCurrentDisplay == NULL) return GL_FALSE;
|
2011-03-30 16:38:25 +00:00
|
|
|
start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
|
|
|
|
if (0 == start) return GL_FALSE;
|
|
|
|
end = start + _glewStrLen(start);
|
|
|
|
return _glewSearchExtension(name, start, end);
|
2003-07-06 15:01:13 +00:00
|
|
|
}
|
|
|
|
|
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;
|
2011-03-30 16:38:25 +00:00
|
|
|
const GLubyte* start;
|
|
|
|
const GLubyte* end;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* 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 */
|
2007-03-19 13:33:36 +00:00
|
|
|
CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE;
|
|
|
|
CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE;
|
|
|
|
CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE;
|
|
|
|
CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE;
|
|
|
|
CONST_CAST(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:
|
2007-03-19 13:33:36 +00:00
|
|
|
CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
|
2004-12-29 05:43:35 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2007-03-19 13:33:36 +00:00
|
|
|
CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
|
|
|
|
CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE;
|
2004-12-29 05:43:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
|
|
|
break;
|
|
|
|
}
|
2003-07-06 15:01:13 +00:00
|
|
|
}
|
2011-03-30 16:38:25 +00:00
|
|
|
/* query GLX extension string */
|
|
|
|
start = 0;
|
|
|
|
if (glXGetCurrentDisplay != NULL)
|
|
|
|
start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
|
|
|
|
if (start == 0)
|
|
|
|
start = (const GLubyte *)"";
|
|
|
|
end = start + _glewStrLen(start);
|
2003-07-06 15:01:13 +00:00
|
|
|
/* initialize extensions */
|