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.
8
** Redistribution and use in source and binary forms, with or without
9
** modification, are permitted provided that the following conditions are met:
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.
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.
32
#ifndef __glew_utils_h__
33
#define __glew_utils_h__
37
# include <GL/wglew.h>
38
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
39
# include <GL/glxew.h>
43
* Define glewGetContext and related helper macros.
46
# define glewGetContext() ctx
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
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
60
# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
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
72
* Define glewGetProcAddress.
75
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
77
# if defined(__APPLE__)
78
extern void* NSGLGetProcAddress (const GLubyte* name);
79
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
81
# if defined(__sgi) || defined(__sun)
82
extern void* dlGetProcAddress (const GLubyte* name);
83
# define glewGetProcAddress(name) dlGetProcAddress(name)
85
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
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.
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)
101
#endif /* __glew_utils_h__ */
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.
8
** Redistribution and use in source and binary forms, with or without
9
** modification, are permitted provided that the following conditions are met:
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.
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.
32
#ifndef __glew_utils_h__
33
#define __glew_utils_h__
37
# include <GL/wglew.h>
38
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
39
# include <GL/glxew.h>
43
* Define glewGetContext and related helper macros.
46
# define glewGetContext() ctx
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
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
60
# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
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
72
* Define glewGetProcAddress.
75
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
77
# if defined(__APPLE__)
78
extern void* NSGLGetProcAddress (const GLubyte* name);
79
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
81
# if defined(__sgi) || defined(__sun)
82
extern void* dlGetProcAddress (const GLubyte* name);
83
# define glewGetProcAddress(name) dlGetProcAddress(name)
85
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
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.
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)
101
#endif /* __glew_utils_h__ */