2003-07-06 15:01:13 +00:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
2004-02-19 04:37:07 +00:00
|
|
|
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
|
|
|
|
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
|
|
|
|
|
2012-05-07 14:05:12 +00:00
|
|
|
GLboolean GLEWAPIENTRY wglewGetExtension (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;
|
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
|
2011-03-30 16:38:25 +00:00
|
|
|
start = (const GLubyte*)_wglewGetExtensionsStringEXT();
|
2003-07-06 15:01:13 +00:00
|
|
|
else
|
2011-03-30 16:38:25 +00:00
|
|
|
start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
|
|
|
|
if (start == 0)
|
|
|
|
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 GLEWAPIENTRY wglewInit ()
|
2003-07-06 15:01:13 +00:00
|
|
|
{
|
2003-09-15 15:35:32 +00:00
|
|
|
GLboolean crippled;
|
2011-03-31 12:49:53 +00:00
|
|
|
const GLubyte* extStart;
|
|
|
|
const GLubyte* extEnd;
|
2003-07-06 15:01:13 +00:00
|
|
|
/* find wgl extension string query functions */
|
2007-04-27 03:05:05 +00:00
|
|
|
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
|
|
|
|
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
|
2011-03-30 16:38:25 +00:00
|
|
|
/* query wgl extension string */
|
|
|
|
if (_wglewGetExtensionsStringARB == NULL)
|
|
|
|
if (_wglewGetExtensionsStringEXT == NULL)
|
2011-03-31 12:49:53 +00:00
|
|
|
extStart = (const GLubyte*)"";
|
2011-03-30 16:38:25 +00:00
|
|
|
else
|
2011-03-31 12:49:53 +00:00
|
|
|
extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
|
2011-03-30 16:38:25 +00:00
|
|
|
else
|
2011-03-31 12:49:53 +00:00
|
|
|
extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
|
|
|
|
extEnd = extStart + _glewStrLen(extStart);
|
2003-07-06 15:01:13 +00:00
|
|
|
/* initialize extensions */
|
2004-02-19 04:37:07 +00:00
|
|
|
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
|