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
|
|
|
}
|
|
|
|
|
2015-11-19 11:12:48 +00:00
|
|
|
GLenum glxewInit ()
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2016-11-13 02:08:32 +00:00
|
|
|
Display* display;
|
2003-07-06 15:01:13 +00:00
|
|
|
int major, minor;
|
2011-03-31 12:49:53 +00:00
|
|
|
const GLubyte* extStart;
|
|
|
|
const GLubyte* extEnd;
|
2017-04-27 10:43:33 +00:00
|
|
|
/* initialize core GLX 1.2 */
|
|
|
|
if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY;
|
2016-11-13 02:08:32 +00:00
|
|
|
/* check for a display */
|
|
|
|
display = glXGetCurrentDisplay();
|
|
|
|
if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY;
|
2004-02-19 04:37:07 +00:00
|
|
|
/* initialize flags */
|
2014-07-14 07:53:21 +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 */
|
2016-11-13 02:08:32 +00:00
|
|
|
glXQueryVersion(display, &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:
|
2014-07-14 07:53:21 +00:00
|
|
|
GLXEW_VERSION_1_4 = GL_FALSE;
|
2004-12-29 05:43:35 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2014-07-14 07:53:21 +00:00
|
|
|
GLXEW_VERSION_1_4 = GL_FALSE;
|
|
|
|
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 */
|
2011-03-31 12:49:53 +00:00
|
|
|
extStart = 0;
|
2011-03-30 16:38:25 +00:00
|
|
|
if (glXGetCurrentDisplay != NULL)
|
2016-11-13 02:08:32 +00:00
|
|
|
extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS);
|
2011-03-31 12:49:53 +00:00
|
|
|
if (extStart == 0)
|
|
|
|
extStart = (const GLubyte *)"";
|
|
|
|
extEnd = extStart + _glewStrLen(extStart);
|
2003-07-06 15:01:13 +00:00
|
|
|
/* initialize extensions */
|