zenilib: zenilib/jni/external/glew/auto/src/glew_init_wgl.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glew_init_wgl.c
Go to the documentation of this file.
1 /* ------------------------------------------------------------------------- */
2
3 static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
4 static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
5
6 GLboolean GLEWAPIENTRY wglewGetExtension (const char* name)
7 {
8 const GLubyte* start;
9 const GLubyte* end;
10 if (_wglewGetExtensionsStringARB == NULL)
11 if (_wglewGetExtensionsStringEXT == NULL)
12 return GL_FALSE;
13 else
14 start = (const GLubyte*)_wglewGetExtensionsStringEXT();
15 else
16 start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
17 if (start == 0)
18 return GL_FALSE;
19 end = start + _glewStrLen(start);
20 return _glewSearchExtension(name, start, end);
21 }
22
23 GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
24 {
25 GLboolean crippled;
26 const GLubyte* extStart;
27 const GLubyte* extEnd;
28 /* find wgl extension string query functions */
29 _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
30 _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
31 /* query wgl extension string */
32 if (_wglewGetExtensionsStringARB == NULL)
33 if (_wglewGetExtensionsStringEXT == NULL)
34 extStart = (const GLubyte*)"";
35 else
36 extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
37 else
38 extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
39 extEnd = extStart + _glewStrLen(extStart);
40 /* initialize extensions */
41 crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
GL_FALSE
#define GL_FALSE
Definition: gl2.h:50
_glewSearchExtension
static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end)
Definition: glew_head.c:237
GLenum
unsigned int GLenum
Definition: gl2.h:23
NULL
#define NULL
Definition: ftobjs.h:61
start
GLuint start
Definition: glew.h:1239
GLboolean
unsigned char GLboolean
Definition: gl2.h:24
WGLEW_CONTEXT_ARG_DEF_LIST
#define WGLEW_CONTEXT_ARG_DEF_LIST
Definition: glew_head.c:33
wglewContextInit
GLenum GLEWAPIENTRY wglewContextInit(WGLEW_CONTEXT_ARG_DEF_LIST)
Definition: glew_init_wgl.c:23
PFNWGLGETEXTENSIONSSTRINGARBPROC
const char *WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC(HDC hdc)
Definition: wglew.h:239
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
glewGetProcAddress
#define glewGetProcAddress(name)
Definition: glew_head.c:141
GLubyte
khronos_uint8_t GLubyte
Definition: gl2.h:30
_glewStrLen
static GLuint _glewStrLen(const GLubyte *s)
Definition: glew_head.c:153
GLEWAPIENTRY
#define GLEWAPIENTRY
Definition: glew_head.h:178
PFNWGLGETEXTENSIONSSTRINGEXTPROC
const char *WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC(void)
Definition: wglew.h:552
end
GLuint GLuint end
Definition: glew.h:1239
_wglewGetExtensionsStringARB
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB
Definition: glew_init_wgl.c:3
wglewGetExtension
GLboolean GLEWAPIENTRY wglewGetExtension(const char *name)
Definition: glew_init_wgl.c:6
_wglewGetExtensionsStringEXT
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT
Definition: glew_init_wgl.c:4