zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glew_utils.h
Go to the documentation of this file.
1 /*
2 ** The OpenGL Extension Wrangler Library
3 ** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
4 ** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
5 ** Copyright (C) 2002, Lev Povalahev
6 ** All rights reserved.
7 **
8 ** Redistribution and use in source and binary forms, with or without
9 ** modification, are permitted provided that the following conditions are met:
10 **
11 ** * Redistributions of source code must retain the above copyright notice,
12 ** this list of conditions and the following disclaimer.
13 ** * Redistributions in binary form must reproduce the above copyright notice,
14 ** this list of conditions and the following disclaimer in the documentation
15 ** and/or other materials provided with the distribution.
16 ** * The name of the author may be used to endorse or promote products
17 ** derived from this software without specific prior written permission.
18 **
19 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 ** THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 
32 #ifndef __glew_utils_h__
33 #define __glew_utils_h__
34 
35 #include <GL/glew.h>
36 #if defined(_WIN32)
37 # include <GL/wglew.h>
38 #elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
39 # include <GL/glxew.h>
40 #endif
41 
42 /*
43  * Define glewGetContext and related helper macros.
44  */
45 #ifdef GLEW_MX
46 # define glewGetContext() ctx
47 # ifdef _WIN32
48 # define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx
49 # define GLEW_CONTEXT_ARG_VAR_INIT ctx
50 # define wglewGetContext() ctx
51 # define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx
52 # define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx
53 # else /* _WIN32 */
54 # define GLEW_CONTEXT_ARG_DEF_INIT void
55 # define GLEW_CONTEXT_ARG_VAR_INIT
56 # define glxewGetContext() ctx
57 # define GLXEW_CONTEXT_ARG_DEF_INIT void
58 # define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx
59 # endif /* _WIN32 */
60 # define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
61 #else /* GLEW_MX */
62 # define GLEW_CONTEXT_ARG_DEF_INIT void
63 # define GLEW_CONTEXT_ARG_VAR_INIT
64 # define GLEW_CONTEXT_ARG_DEF_LIST void
65 # define WGLEW_CONTEXT_ARG_DEF_INIT void
66 # define WGLEW_CONTEXT_ARG_DEF_LIST void
67 # define GLXEW_CONTEXT_ARG_DEF_INIT void
68 # define GLXEW_CONTEXT_ARG_DEF_LIST void
69 #endif /* GLEW_MX */
70 
71 /*
72  * Define glewGetProcAddress.
73  */
74 #if defined(_WIN32)
75 # define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
76 #else
77 # if defined(__APPLE__)
78  extern void* NSGLGetProcAddress (const GLubyte* name);
79 # define glewGetProcAddress(name) NSGLGetProcAddress(name)
80 # else
81 # if defined(__sgi) || defined(__sun)
82  extern void* dlGetProcAddress (const GLubyte* name);
83 # define glewGetProcAddress(name) dlGetProcAddress(name)
84 # else /* __linux */
85 # define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
86 # endif
87 # endif
88 #endif
89 
90 /*
91  * GLEW, just like OpenGL or GLU, does not rely on the standard C library.
92  * These functions implement the string processing functionality required in the library.
93  */
94 extern GLuint _glewStrLen (const GLubyte* s);
95 extern GLuint _glewStrCLen (const GLubyte* s, GLubyte c);
96 extern GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n);
97 extern GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb);
98 extern GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb);
99 extern GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
100 
101 #endif /* __glew_utils_h__ */
GLdouble s
Definition: glew.h:1376
unsigned char GLboolean
Definition: gl2.h:24
GLclampd n
Definition: glew.h:7287
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8736
EGLImageKHR EGLint * name
Definition: eglext.h:284
static GLuint _glewStrCLen(const GLubyte *s, GLubyte c)
Definition: glew_head.c:161
static GLboolean _glewStrSame(const GLubyte *a, const GLubyte *b, GLuint n)
Definition: glew_head.c:169
khronos_uint8_t GLubyte
Definition: gl2.h:30
const GLfloat * c
Definition: glew.h:14913
static GLboolean _glewStrSame1(GLubyte **a, GLuint *na, const GLubyte *b, GLuint nb)
Definition: glew_head.c:178
static GLuint _glewStrLen(const GLubyte *s)
Definition: glew_head.c:153
static GLboolean _glewStrSame2(GLubyte **a, GLuint *na, const GLubyte *b, GLuint nb)
Definition: glew_head.c:199
unsigned int GLuint
Definition: gl2.h:32
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
GLboolean _glewStrSame3(GLubyte **a, GLuint *na, const GLubyte *b, GLuint nb)
Definition: glew_utils.c:148