gl_common: move header hacks into gl_header_fixes.h
[mplayer.git] / libvo / gl_header_fixes.h
blobc6f260b289115f06caa2d16deb764a0af6f43270
1 /*
2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * You can alternatively redistribute this file and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
24 // workaround for some gl.h headers
25 #ifndef GLAPIENTRY
26 #ifdef APIENTRY
27 #define GLAPIENTRY APIENTRY
28 #elif defined(CONFIG_GL_WIN32)
29 #define GLAPIENTRY __stdcall
30 #else
31 #define GLAPIENTRY
32 #endif
33 #endif
35 /**
36 * \defgroup glextdefines OpenGL extension defines
38 * conditionally define all extension defines used.
39 * vendor specific extensions should be marked as such
40 * (e.g. _NV), _ARB is not used to ease readability.
41 * \{
43 #ifndef GL_TEXTURE_3D
44 #define GL_TEXTURE_3D 0x806F
45 #endif
46 #ifndef GL_TEXTURE_WRAP_R
47 #define GL_TEXTURE_WRAP_R 0x8072
48 #endif
49 #ifndef GL_CLAMP_TO_EDGE
50 #define GL_CLAMP_TO_EDGE 0x812F
51 #endif
52 #ifndef GL_GENERATE_MIPMAP
53 #define GL_GENERATE_MIPMAP 0x8191
54 #endif
55 #ifndef GL_TEXT_FRAGMENT_SHADER_ATI
56 #define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
57 #endif
58 #ifndef GL_FRAGMENT_SHADER_ATI
59 #define GL_FRAGMENT_SHADER_ATI 0x8920
60 #endif
61 #ifndef GL_NUM_FRAGMENT_REGISTERS_ATI
62 #define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
63 #endif
64 #ifndef GL_REG_0_ATI
65 #define GL_REG_0_ATI 0x8921
66 #endif
67 #ifndef GL_REG_1_ATI
68 #define GL_REG_1_ATI 0x8922
69 #endif
70 #ifndef GL_REG_2_ATI
71 #define GL_REG_2_ATI 0x8923
72 #endif
73 #ifndef GL_CON_0_ATI
74 #define GL_CON_0_ATI 0x8941
75 #endif
76 #ifndef GL_CON_1_ATI
77 #define GL_CON_1_ATI 0x8942
78 #endif
79 #ifndef GL_CON_2_ATI
80 #define GL_CON_2_ATI 0x8943
81 #endif
82 #ifndef GL_CON_3_ATI
83 #define GL_CON_3_ATI 0x8944
84 #endif
85 #ifndef GL_ADD_ATI
86 #define GL_ADD_ATI 0x8963
87 #endif
88 #ifndef GL_MUL_ATI
89 #define GL_MUL_ATI 0x8964
90 #endif
91 #ifndef GL_MAD_ATI
92 #define GL_MAD_ATI 0x8968
93 #endif
94 #ifndef GL_SWIZZLE_STR_ATI
95 #define GL_SWIZZLE_STR_ATI 0x8976
96 #endif
97 #ifndef GL_4X_BIT_ATI
98 #define GL_4X_BIT_ATI 2
99 #endif
100 #ifndef GL_8X_BIT_ATI
101 #define GL_8X_BIT_ATI 4
102 #endif
103 #ifndef GL_BIAS_BIT_ATI
104 #define GL_BIAS_BIT_ATI 8
105 #endif
106 #ifndef GL_MAX_TEXTURE_UNITS
107 #define GL_MAX_TEXTURE_UNITS 0x84E2
108 #endif
109 #ifndef GL_TEXTURE0
110 #define GL_TEXTURE0 0x84C0
111 #endif
112 #ifndef GL_TEXTURE1
113 #define GL_TEXTURE1 0x84C1
114 #endif
115 #ifndef GL_TEXTURE2
116 #define GL_TEXTURE2 0x84C2
117 #endif
118 #ifndef GL_TEXTURE3
119 #define GL_TEXTURE3 0x84C3
120 #endif
121 #ifndef GL_TEXTURE_RECTANGLE
122 #define GL_TEXTURE_RECTANGLE 0x84F5
123 #endif
124 #ifndef GL_PIXEL_UNPACK_BUFFER
125 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
126 #endif
127 #ifndef GL_STREAM_DRAW
128 #define GL_STREAM_DRAW 0x88E0
129 #endif
130 #ifndef GL_DYNAMIC_DRAW
131 #define GL_DYNAMIC_DRAW 0x88E8
132 #endif
133 #ifndef GL_WRITE_ONLY
134 #define GL_WRITE_ONLY 0x88B9
135 #endif
136 #ifndef GL_BGR
137 #define GL_BGR 0x80E0
138 #endif
139 #ifndef GL_BGRA
140 #define GL_BGRA 0x80E1
141 #endif
142 #ifndef GL_UNSIGNED_BYTE_3_3_2
143 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
144 #endif
145 #ifndef GL_UNSIGNED_BYTE_2_3_3_REV
146 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
147 #endif
148 #ifndef GL_UNSIGNED_SHORT_4_4_4_4
149 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
150 #endif
151 #ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV
152 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
153 #endif
154 #ifndef GL_UNSIGNED_SHORT_5_6_5
155 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
156 #endif
157 #ifndef GL_UNSIGNED_INT_8_8_8_8
158 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
159 #endif
160 #ifndef GL_UNSIGNED_INT_8_8_8_8_REV
161 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
162 #endif
163 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV
164 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
165 #endif
166 #ifndef GL_UNSIGNED_INT_10_10_10_2
167 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
168 #endif
169 #ifndef GL_UNSIGNED_INT_2_10_10_10_REV
170 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
171 #endif
172 #ifndef GL_UNSIGNED_SHORT_5_5_5_1
173 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
174 #endif
175 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
176 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
177 #endif
178 #ifndef GL_UNSIGNED_SHORT_8_8
179 #define GL_UNSIGNED_SHORT_8_8 0x85BA
180 #endif
181 #ifndef GL_UNSIGNED_SHORT_8_8_REV
182 #define GL_UNSIGNED_SHORT_8_8_REV 0x85BB
183 #endif
184 #ifndef GL_YCBCR_MESA
185 #define GL_YCBCR_MESA 0x8757
186 #endif
187 #ifndef GL_RGB32F
188 #define GL_RGB32F 0x8815
189 #endif
190 #ifndef GL_FLOAT_RGB32_NV
191 #define GL_FLOAT_RGB32_NV 0x8889
192 #endif
193 #ifndef GL_LUMINANCE16
194 #define GL_LUMINANCE16 0x8042
195 #endif
196 #ifndef GL_R16
197 #define GL_R16 0x822A
198 #endif
199 #ifndef GL_UNPACK_CLIENT_STORAGE_APPLE
200 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
201 #endif
202 #ifndef GL_FRAGMENT_PROGRAM
203 #define GL_FRAGMENT_PROGRAM 0x8804
204 #endif
205 #ifndef GL_PROGRAM_FORMAT_ASCII
206 #define GL_PROGRAM_FORMAT_ASCII 0x8875
207 #endif
208 #ifndef GL_PROGRAM_ERROR_POSITION
209 #define GL_PROGRAM_ERROR_POSITION 0x864B
210 #endif
211 #ifndef GL_MAX_TEXTURE_IMAGE_UNITS
212 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
213 #endif
214 #ifndef GL_PROGRAM_ERROR_STRING
215 #define GL_PROGRAM_ERROR_STRING 0x8874
216 #endif
217 /** \} */ // end of glextdefines group
220 #if defined(CONFIG_GL_WIN32) && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB)
221 /* these are supposed to be defined in wingdi.h but mingw's is too old */
222 /* only the bits actually used by mplayer are defined */
223 /* reference: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt */
225 #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
226 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
227 #define WGL_CONTEXT_FLAGS_ARB 0x2094
228 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
229 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
230 #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
231 #endif