2003-07-06 15:01:13 +00:00
|
|
|
return GLEW_OK;
|
|
|
|
}
|
|
|
|
|
2003-10-27 01:13:51 +00:00
|
|
|
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
|
2003-07-06 15:01:13 +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-02-19 04:37:07 +00:00
|
|
|
if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE;
|
|
|
|
p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay()));
|
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 04:37:07 +00:00
|
|
|
#ifndef GLEW_MX
|
|
|
|
static
|
|
|
|
#endif
|
2004-02-01 18:13:05 +00:00
|
|
|
GLenum glxewContextInit (GLXEWContext* ctx)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
|
|
|
int major, minor;
|
|
|
|
/* initialize core GLX 1.2 */
|
2004-02-01 18:13:05 +00:00
|
|
|
if (_glewInit_GLX_VERSION_1_2(ctx)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
2004-02-19 04:37:07 +00:00
|
|
|
/* initialize flags */
|
|
|
|
GLXEW_VERSION_1_0 = GL_FALSE;
|
|
|
|
GLXEW_VERSION_1_1 = GL_FALSE;
|
|
|
|
GLXEW_VERSION_1_2 = GL_FALSE;
|
|
|
|
GLXEW_VERSION_1_3 = GL_FALSE;
|
|
|
|
GLXEW_VERSION_1_4 = GL_FALSE;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* query GLX version */
|
|
|
|
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
|
|
|
|
switch (minor)
|
|
|
|
{
|
|
|
|
case 4:
|
2004-02-19 04:37:07 +00:00
|
|
|
GLXEW_VERSION_1_4 = GL_TRUE;
|
2003-07-06 15:01:13 +00:00
|
|
|
case 3:
|
2004-02-19 04:37:07 +00:00
|
|
|
GLXEW_VERSION_1_3 = GL_TRUE;
|
2003-07-06 15:01:13 +00:00
|
|
|
case 2:
|
2004-02-19 04:37:07 +00:00
|
|
|
GLXEW_VERSION_1_2 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_1 = GL_TRUE;
|
|
|
|
GLXEW_VERSION_1_0 = GL_TRUE;
|
2003-07-06 15:01:13 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* initialize extensions */
|