2003-07-06 15:01:13 +00:00
|
|
|
return GLEW_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
2004-02-19 04:37:07 +00:00
|
|
|
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
|
|
|
|
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
|
|
|
|
|
2004-02-01 22:27:31 +00:00
|
|
|
GLboolean wglewGetExtension (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 (_wglewGetExtensionsStringARB == NULL)
|
|
|
|
if (_wglewGetExtensionsStringEXT == NULL)
|
2003-07-06 15:01:13 +00:00
|
|
|
return GL_FALSE;
|
|
|
|
else
|
2004-02-19 04:37:07 +00:00
|
|
|
p = (GLubyte*)_wglewGetExtensionsStringEXT();
|
2003-07-06 15:01:13 +00:00
|
|
|
else
|
2004-02-19 04:37:07 +00:00
|
|
|
p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
|
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 wglewContextInit (WGLEWContext* ctx)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2003-09-15 15:35:32 +00:00
|
|
|
GLboolean crippled;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* find wgl extension string query functions */
|
2004-02-19 04:37:07 +00:00
|
|
|
if (_wglewGetExtensionsStringARB == NULL)
|
|
|
|
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
|
|
|
|
if (_wglewGetExtensionsStringEXT == NULL)
|
|
|
|
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
|
2003-07-06 15:01:13 +00:00
|
|
|
/* initialize extensions */
|
2004-02-19 04:37:07 +00:00
|
|
|
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
|