blob: 978cf3cce6e0c2babf0ae4f0a011ebd3d17eb8a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* ------------------------------------------------------------------------- */
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
GLboolean GLEWAPIENTRY 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 GLEWAPIENTRY wglewInit ()
{
GLboolean crippled;
const GLubyte* extStart;
const GLubyte* extEnd;
/* 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)
extStart = (const GLubyte*)"";
else
extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
else
extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
extEnd = extStart + _glewStrLen(extStart);
/* initialize extensions */
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
|