kusano 7d535a
/* ------------------------------------------------------------------------- */
kusano 7d535a
kusano 7d535a
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
kusano 7d535a
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
kusano 7d535a
kusano 7d535a
GLboolean GLEWAPIENTRY wglewGetExtension (const char* name)
kusano 7d535a
{    
kusano 7d535a
  const GLubyte* start;
kusano 7d535a
  const GLubyte* end;
kusano 7d535a
  if (_wglewGetExtensionsStringARB == NULL)
kusano 7d535a
    if (_wglewGetExtensionsStringEXT == NULL)
kusano 7d535a
      return GL_FALSE;
kusano 7d535a
    else
kusano 7d535a
      start = (const GLubyte*)_wglewGetExtensionsStringEXT();
kusano 7d535a
  else
kusano 7d535a
    start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
kusano 7d535a
  if (start == 0)
kusano 7d535a
    return GL_FALSE;
kusano 7d535a
  end = start + _glewStrLen(start);
kusano 7d535a
  return _glewSearchExtension(name, start, end);
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
kusano 7d535a
{
kusano 7d535a
  GLboolean crippled;
kusano 7d535a
  const GLubyte* extStart;
kusano 7d535a
  const GLubyte* extEnd;
kusano 7d535a
  /* find wgl extension string query functions */
kusano 7d535a
  _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
kusano 7d535a
  _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
kusano 7d535a
  /* query wgl extension string */
kusano 7d535a
  if (_wglewGetExtensionsStringARB == NULL)
kusano 7d535a
    if (_wglewGetExtensionsStringEXT == NULL)
kusano 7d535a
      extStart = (const GLubyte*)"";
kusano 7d535a
    else
kusano 7d535a
      extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
kusano 7d535a
  else
kusano 7d535a
    extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
kusano 7d535a
  extEnd = extStart + _glewStrLen(extStart);
kusano 7d535a
  /* initialize extensions */
kusano 7d535a
  crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;