2003-07-06 15:01:13 +00:00
|
|
|
return GLEW_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
2004-02-01 18:13:05 +00:00
|
|
|
GLboolean wglewGetExtension (const GLubyte* name)
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2004-02-01 18:13:05 +00:00
|
|
|
GLubyte* p;
|
|
|
|
GLubyte* end;
|
2003-09-15 16:53:02 +00:00
|
|
|
GLuint len = _glewStrLen(name);
|
2004-02-01 18:13:05 +00:00
|
|
|
if (wglewDefaultContext->__wglewGetExtensionsStringARB == NULL)
|
|
|
|
if (wglewDefaultContext->__wglewGetExtensionsStringEXT == NULL)
|
2003-07-06 15:01:13 +00:00
|
|
|
return GL_FALSE;
|
|
|
|
else
|
2004-02-01 18:13:05 +00:00
|
|
|
p = (GLubyte*)wglewDefaultContext->__wglewGetExtensionsStringEXT();
|
2003-07-06 15:01:13 +00:00
|
|
|
else
|
2004-02-01 18:13:05 +00:00
|
|
|
p = (GLubyte*)wglewDefaultContext->__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, ' ');
|
2003-07-06 15:01:13 +00:00
|
|
|
if (len == n && _glewStrSame(name, p, n)) return GL_TRUE;
|
|
|
|
p += n+1;
|
|
|
|
}
|
|
|
|
return GL_FALSE;
|
|
|
|
}
|
|
|
|
|
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-01 18:13:05 +00:00
|
|
|
_glewInit_WGL_ARB_extensions_string(ctx);
|
|
|
|
ctx->__WGLEW_ARB_extensions_string = (ctx->__wglewGetExtensionsStringARB != NULL);
|
|
|
|
wglewDefaultContext->__wglewGetExtensionsStringARB = ctx->__wglewGetExtensionsStringARB;
|
|
|
|
wglewDefaultContext->__WGLEW_ARB_extensions_string = ctx->__WGLEW_ARB_extensions_string;
|
|
|
|
_glewInit_WGL_EXT_extensions_string(ctx);
|
|
|
|
ctx->__WGLEW_EXT_extensions_string = (ctx->__wglewGetExtensionsStringEXT != NULL);
|
|
|
|
wglewDefaultContext->__wglewGetExtensionsStringEXT = ctx->__wglewGetExtensionsStringEXT;
|
|
|
|
wglewDefaultContext->__WGLEW_EXT_extensions_string = ctx->__WGLEW_EXT_extensions_string;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* initialize extensions */
|
2004-02-01 18:13:05 +00:00
|
|
|
crippled = !(ctx->__WGLEW_ARB_extensions_string || ctx->__WGLEW_EXT_extensions_string);
|