mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-24 23:05:06 +00:00
42 lines
1.6 KiB
C
42 lines
1.6 KiB
C
/* ------------------------------------------------------------------------- */
|
|
|
|
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
|
|
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
|
|
|
|
GLboolean wglewGetExtension (const char* name)
|
|
{
|
|
const GLubyte* start;
|
|
const GLubyte* end;
|
|
if (_wglewGetExtensionsStringARB == NULL)
|
|
if (_wglewGetExtensionsStringEXT == NULL)
|
|
return GL_FALSE;
|
|
else
|
|
start = (const GLubyte*)_wglewGetExtensionsStringEXT();
|
|
else
|
|
start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
|
|
if (start == 0)
|
|
return GL_FALSE;
|
|
end = start + _glewStrLen(start);
|
|
return _glewSearchExtension(name, start, end);
|
|
}
|
|
|
|
GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
|
|
{
|
|
GLboolean crippled;
|
|
const GLubyte* start;
|
|
const GLubyte* end;
|
|
/* find wgl extension string query functions */
|
|
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
|
|
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
|
|
/* query wgl extension string */
|
|
if (_wglewGetExtensionsStringARB == NULL)
|
|
if (_wglewGetExtensionsStringEXT == NULL)
|
|
start = (const GLubyte*)"";
|
|
else
|
|
start = (const GLubyte*)_wglewGetExtensionsStringEXT();
|
|
else
|
|
start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
|
|
end = start + _glewStrLen(start);
|
|
/* initialize extensions */
|
|
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
|