apple: Integrate our libGL into the existing build system better
[mesa.git] / src / glx / apple / include / GL / gl.h.template
1 /*
2 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
3 * Copyright (C) 2009 Apple Inc. All Rights Reserved.
4 *
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:
11 *
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
14 *
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.
21 */
22
23 #ifndef __X_GL_H
24 #define __X_GL_H
25
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.
28 */
29 @CGL_MESA_COMPAT_MACROS@
30
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
33 * can't give us both.
34 */
35
36 #ifdef GL_GLEXT_FUNCTION_POINTERS
37 #define _GL_GLEXT_FUNCTION_POINTERS GL_GLEXT_FUNCTION_POINTERS
38 #undef GL_GLEXT_FUNCTION_POINTERS
39 #endif
40
41 #ifdef GL_GLEXT_PROTOTYPES
42 #define _GL_GLEXT_PROTOTYPES GL_GLEXT_PROTOTYPES
43 #else
44 #define GL_GLEXT_PROTOTYPES 1
45 #endif
46
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
50 #else
51 #define GL_GLEXT_LEGACY 1
52 #endif
53
54 #include "/System/Library/Frameworks/OpenGL.framework/Headers/gl.h"
55
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
60
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
65 #endif
66
67 #ifdef _GL_GLEXT_PROTOTYPES
68 #undef _GL_GLEXT_PROTOTYPES
69 #else
70 #undef GL_GLEXT_PROTOTYPES
71 #endif
72
73 #ifdef _GL_GLEXT_LEGACY
74 #undef _GL_GLEXT_LEGACY
75 #else
76 #undef GL_GLEXT_LEGACY
77 #endif
78
79 @CGL_MESA_FUNCTION_POINTERS@
80
81 #ifndef GL_GLEXT_LEGACY
82 #include <GL/glext.h>
83 #endif
84
85 /*
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:
88 */
89 #ifndef GL_TEXTURE_RECTANGLE_EXT
90 #define GL_TEXTURE_RECTANGLE_EXT 0x84F5
91 #endif
92
93 /* This is needed for building the X server: */
94 /*
95 * GL_MESA_packed_depth_stencil
96 */
97 #ifndef GL_MESA_packed_depth_stencil
98 #define GL_MESA_packed_depth_stencil 1
99
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
105
106 #endif /* GL_MESA_packed_depth_stencil */
107
108 /* Various other OS projects expect to get these macros from Mesa's gl.h */
109 #ifndef GLAPI
110 #define GLAPI extern
111 #endif
112
113 #ifndef GLAPIENTRY
114 #define GLAPIENTRY
115 #endif
116
117 #ifndef APIENTRY
118 #define APIENTRY GLAPIENTRY
119 #endif
120
121 /* "P" suffix to be used for a pointer to a function */
122 #ifndef APIENTRYP
123 #define APIENTRYP APIENTRY *
124 #endif
125
126 #ifndef GLAPIENTRYP
127 #define GLAPIENTRYP GLAPIENTRY *
128 #endif
129
130 #endif /*__X_GL_H*/