2 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
3 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 /* The following macros exist to address conflicts between the names given to
27 * function pointers by the MESA API and OpenGL.framework's API.
29 @CGL_MESA_COMPAT_MACROS@
31 /* On SL, we want to use OpelGL.framework's headers to get both prototypes and
32 * function pointers (like Mesa's API), but on Leo and before, OpenGL.framework
36 #ifdef GL_GLEXT_FUNCTION_POINTERS
37 #define _GL_GLEXT_FUNCTION_POINTERS GL_GLEXT_FUNCTION_POINTERS
38 #undef GL_GLEXT_FUNCTION_POINTERS
41 #ifdef GL_GLEXT_PROTOTYPES
42 #define _GL_GLEXT_PROTOTYPES GL_GLEXT_PROTOTYPES
44 #define GL_GLEXT_PROTOTYPES 1
47 /* Our glext.h is based on a version from the registry that is newer. */
48 #ifdef GL_GLEXT_LEGACY
49 #define _GL_GLEXT_LEGACY GL_GLEXT_LEGACY
51 #define GL_GLEXT_LEGACY 1
54 #include "/System/Library/Frameworks/OpenGL.framework/Headers/gl.h"
56 /* These are not set by the system gl.h */
57 #define GL_VERSION_1_2_DEPRECATED 1
58 #define GL_VERSION_1_3_DEPRECATED 1
59 #define GL_VERSION_1_4_DEPRECATED 1
61 /* Restore our GLEXT-fu */
62 #ifdef _GL_GLEXT_FUNCTION_POINTERS
63 #define GL_GLEXT_FUNCTION_POINTERS _GL_GLEXT_FUNCTION_POINTERS
64 #undef _GL_GLEXT_FUNCTION_POINTERS
67 #ifdef _GL_GLEXT_PROTOTYPES
68 #undef _GL_GLEXT_PROTOTYPES
70 #undef GL_GLEXT_PROTOTYPES
73 #ifdef _GL_GLEXT_LEGACY
74 #undef _GL_GLEXT_LEGACY
76 #undef GL_GLEXT_LEGACY
79 @CGL_MESA_FUNCTION_POINTERS@
81 #ifndef GL_GLEXT_LEGACY
86 * This is needed for building apple_glx_pbuffer.c, the latest
87 * glext.h from the registry lacks it, so it's from the Leopard glext.h:
89 #ifndef GL_TEXTURE_RECTANGLE_EXT
90 #define GL_TEXTURE_RECTANGLE_EXT 0x84F5
93 /* This is needed for building the X server: */
95 * GL_MESA_packed_depth_stencil
97 #ifndef GL_MESA_packed_depth_stencil
98 #define GL_MESA_packed_depth_stencil 1
100 #define GL_DEPTH_STENCIL_MESA 0x8750
101 #define GL_UNSIGNED_INT_24_8_MESA 0x8751
102 #define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
103 #define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
104 #define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
106 #endif /* GL_MESA_packed_depth_stencil */
108 /* Various other OS projects expect to get these macros from Mesa's gl.h */
118 #define APIENTRY GLAPIENTRY
121 /* "P" suffix to be used for a pointer to a function */
123 #define APIENTRYP APIENTRY *
127 #define GLAPIENTRYP GLAPIENTRY *