kusano 7d535a
/* ------------------------------------------------------------------------ */
kusano 7d535a
kusano 7d535a
GLboolean glxewGetExtension (const char* name)
kusano 7d535a
{    
kusano 7d535a
  const GLubyte* start;
kusano 7d535a
  const GLubyte* end;
kusano 7d535a
kusano 7d535a
  if (glXGetCurrentDisplay == NULL) return GL_FALSE;
kusano 7d535a
  start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
kusano 7d535a
  if (0 == start) return GL_FALSE;
kusano 7d535a
  end = start + _glewStrLen(start);
kusano 7d535a
  return _glewSearchExtension(name, start, end);
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
kusano 7d535a
{
kusano 7d535a
  int major, minor;
kusano 7d535a
  const GLubyte* extStart;
kusano 7d535a
  const GLubyte* extEnd;
kusano 7d535a
  /* initialize core GLX 1.2 */
kusano 7d535a
  if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
kusano 7d535a
  /* initialize flags */
kusano 7d535a
  CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE;
kusano 7d535a
  CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE;
kusano 7d535a
  CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE;
kusano 7d535a
  CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE;
kusano 7d535a
  CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE;
kusano 7d535a
  /* query GLX version */
kusano 7d535a
  glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
kusano 7d535a
  if (major == 1 && minor <= 3)
kusano 7d535a
  {
kusano 7d535a
    switch (minor)
kusano 7d535a
    {
kusano 7d535a
      case 3:
kusano 7d535a
      CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
kusano 7d535a
      break;
kusano 7d535a
      case 2:
kusano 7d535a
      CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
kusano 7d535a
      CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE;
kusano 7d535a
      break;
kusano 7d535a
      default:
kusano 7d535a
      return GLEW_ERROR_GLX_VERSION_11_ONLY;
kusano 7d535a
      break;
kusano 7d535a
    }
kusano 7d535a
  }
kusano 7d535a
  /* query GLX extension string */
kusano 7d535a
  extStart = 0;
kusano 7d535a
  if (glXGetCurrentDisplay != NULL)
kusano 7d535a
    extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
kusano 7d535a
  if (extStart == 0)
kusano 7d535a
    extStart = (const GLubyte *)"";
kusano 7d535a
  extEnd = extStart + _glewStrLen(extStart);
kusano 7d535a
  /* initialize extensions */