1 /*
2  * This file is part of MPlayer.
3  *
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.
8  *
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.
13  *
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.
17  *
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.
22  */
23 
24 #ifndef MPLAYER_GL_COMPAT_H
25 #define MPLAYER_GL_COMPAT_H
26 
27 // workaround for some gl.h headers
28 #ifndef GLAPIENTRY
29 #ifdef APIENTRY
30 #define GLAPIENTRY APIENTRY
31 #elif defined(CONFIG_GL_WIN32)
32 #define GLAPIENTRY __stdcall
33 #else
34 #define GLAPIENTRY
35 #endif
36 #endif
37 
38 // base OpenGL defines
39 #ifndef GL_NONE
40 #define GL_NONE 0
41 #endif
42 
43 #ifndef GL_QUADS
44 #define GL_QUADS 0x0007
45 #endif
46 
47 #ifndef GL_FRONT_LEFT
48 #define GL_FRONT_LEFT 0x0400
49 #endif
50 #ifndef GL_FRONT_RIGHT
51 #define GL_FRONT_RIGHT 0x0401
52 #endif
53 #ifndef GL_BACK_LEFT
54 #define GL_BACK_LEFT 0x0402
55 #endif
56 #ifndef GL_BACK_RIGHT
57 #define GL_BACK_RIGHT 0x0403
58 #endif
59 
60 #ifndef GL_DRAW_BUFFER
61 #define GL_DRAW_BUFFER 0x0C01
62 #endif
63 #ifndef GL_UNPACK_ROW_LENGTH
64 #define GL_UNPACK_ROW_LENGTH 0x0CF2
65 #endif
66 
67 #ifndef GL_TEXTURE_1D
68 #define GL_TEXTURE_1D 0x0DE0
69 #endif
70 #ifndef GL_TEXTURE_BORDER_COLOR
71 #define GL_TEXTURE_BORDER_COLOR 0x1004
72 #endif
73 #ifndef GL_COMPILE
74 #define GL_COMPILE 0x1300
75 #endif
76 #ifndef GL_CLAMP
77 #define GL_CLAMP 0x2900
78 #endif
79 
80 #ifndef GL_INT
81 #define GL_INT 0x1404
82 #endif
83 #ifndef GL_UNSIGNED_INT
84 #define GL_UNSIGNED_INT 0x1405
85 #endif
86 #ifndef GL_2_BYTES
87 #define GL_2_BYTES 0x1407
88 #endif
89 #ifndef GL_3_BYTES
90 #define GL_3_BYTES 0x1408
91 #endif
92 #ifndef GL_4_BYTES
93 #define GL_4_BYTES 0x1409
94 #endif
95 #ifndef GL_DOUBLE
96 #define GL_DOUBLE 0x140A
97 #endif
98 
99 #ifndef GL_COLOR_INDEX
100 #define GL_COLOR_INDEX 0x1900
101 #endif
102 #ifndef GL_RED
103 #define GL_RED 0x1903
104 #endif
105 #ifndef GL_GREEN
106 #define GL_GREEN 0x1904
107 #endif
108 #ifndef GL_BLUE
109 #define GL_BLUE 0x1905
110 #endif
111 #ifndef GL_R3_G3_B2
112 #define GL_R3_G3_B2 0x2A10
113 #endif
114 #ifndef GL_LUMINANCE8
115 #define GL_LUMINANCE8 0x8040
116 #endif
117 #ifndef GL_RGB4
118 #define GL_RGB4 0x804F
119 #endif
120 #ifndef GL_RGB5
121 #define GL_RGB5 0x8050
122 #endif
123 #ifndef GL_RGB8
124 #define GL_RGB8 0x8051
125 #endif
126 #ifndef GL_RGB10
127 #define GL_RGB10 0x8052
128 #endif
129 #ifndef GL_RGB12
130 #define GL_RGB12 0x8053
131 #endif
132 #ifndef GL_RGB16
133 #define GL_RGB16 0x8054
134 #endif
135 #ifndef GL_RGBA2
136 #define GL_RGBA2 0x8055
137 #endif
138 #ifndef GL_RGBA4
139 #define GL_RGBA4 0x8056
140 #endif
141 #ifndef GL_RGB5_A1
142 #define GL_RGB5_A1 0x8057
143 #endif
144 #ifndef GL_RGBA8
145 #define GL_RGBA8  0x8058
146 #endif
147 #ifndef GL_RGB10_A2
148 #define GL_RGB10_A2 0x8059
149 #endif
150 #ifndef GL_RGBA12
151 #define GL_RGBA12 0x805A
152 #endif
153 #ifndef GL_RGBA16
154 #define GL_RGBA16 0x805B
155 #endif
156 
157 #ifndef GL_TEXTURE_PRIORITY
158 #define GL_TEXTURE_PRIORITY 0x8066
159 #endif
160 
161 
162 /**
163  * \defgroup glextdefines OpenGL extension defines
164  *
165  * conditionally define all extension defines used.
166  * vendor specific extensions should be marked as such
167  * (e.g. _NV), _ARB is not used to ease readability.
168  * \{
169  */
170 #ifndef GL_TEXTURE_3D
171 #define GL_TEXTURE_3D 0x806F
172 #endif
173 #ifndef GL_TEXTURE_WRAP_R
174 #define GL_TEXTURE_WRAP_R 0x8072
175 #endif
176 #ifndef GL_CLAMP_TO_EDGE
177 #define GL_CLAMP_TO_EDGE 0x812F
178 #endif
179 #ifndef GL_GENERATE_MIPMAP
180 #define GL_GENERATE_MIPMAP 0x8191
181 #endif
182 #ifndef GL_TEXT_FRAGMENT_SHADER_ATI
183 #define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
184 #endif
185 #ifndef GL_REGISTER_COMBINERS_NV
186 #define GL_REGISTER_COMBINERS_NV 0x8522
187 #endif
188 #ifndef GL_MAX_GENERAL_COMBINERS_NV
189 #define GL_MAX_GENERAL_COMBINERS_NV 0x854D
190 #endif
191 #ifndef GL_NUM_GENERAL_COMBINERS_NV
192 #define GL_NUM_GENERAL_COMBINERS_NV 0x854E
193 #endif
194 #ifndef GL_CONSTANT_COLOR0_NV
195 #define GL_CONSTANT_COLOR0_NV 0x852A
196 #endif
197 #ifndef GL_CONSTANT_COLOR1_NV
198 #define GL_CONSTANT_COLOR1_NV 0x852B
199 #endif
200 #ifndef GL_COMBINER0_NV
201 #define GL_COMBINER0_NV 0x8550
202 #endif
203 #ifndef GL_COMBINER1_NV
204 #define GL_COMBINER1_NV 0x8551
205 #endif
206 #ifndef GL_VARIABLE_A_NV
207 #define GL_VARIABLE_A_NV 0x8523
208 #endif
209 #ifndef GL_VARIABLE_B_NV
210 #define GL_VARIABLE_B_NV 0x8524
211 #endif
212 #ifndef GL_VARIABLE_C_NV
213 #define GL_VARIABLE_C_NV 0x8525
214 #endif
215 #ifndef GL_VARIABLE_D_NV
216 #define GL_VARIABLE_D_NV 0x8526
217 #endif
218 #ifndef GL_UNSIGNED_INVERT_NV
219 #define GL_UNSIGNED_INVERT_NV 0x8537
220 #endif
221 #ifndef GL_HALF_BIAS_NORMAL_NV
222 #define GL_HALF_BIAS_NORMAL_NV 0x853A
223 #endif
224 #ifndef GL_SIGNED_IDENTITY_NV
225 #define GL_SIGNED_IDENTITY_NV 0x853C
226 #endif
227 #ifndef GL_SCALE_BY_FOUR_NV
228 #define GL_SCALE_BY_FOUR_NV 0x853F
229 #endif
230 #ifndef GL_DISCARD_NV
231 #define GL_DISCARD_NV 0x8530
232 #endif
233 #ifndef GL_SPARE0_NV
234 #define GL_SPARE0_NV 0x852E
235 #endif
236 #ifndef GL_FRAGMENT_SHADER_ATI
237 #define GL_FRAGMENT_SHADER_ATI 0x8920
238 #endif
239 #ifndef GL_NUM_FRAGMENT_REGISTERS_ATI
240 #define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
241 #endif
242 #ifndef GL_REG_0_ATI
243 #define GL_REG_0_ATI 0x8921
244 #endif
245 #ifndef GL_REG_1_ATI
246 #define GL_REG_1_ATI 0x8922
247 #endif
248 #ifndef GL_REG_2_ATI
249 #define GL_REG_2_ATI 0x8923
250 #endif
251 #ifndef GL_CON_0_ATI
252 #define GL_CON_0_ATI 0x8941
253 #endif
254 #ifndef GL_CON_1_ATI
255 #define GL_CON_1_ATI 0x8942
256 #endif
257 #ifndef GL_CON_2_ATI
258 #define GL_CON_2_ATI 0x8943
259 #endif
260 #ifndef GL_CON_3_ATI
261 #define GL_CON_3_ATI 0x8944
262 #endif
263 #ifndef GL_ADD_ATI
264 #define GL_ADD_ATI 0x8963
265 #endif
266 #ifndef GL_MUL_ATI
267 #define GL_MUL_ATI 0x8964
268 #endif
269 #ifndef GL_MAD_ATI
270 #define GL_MAD_ATI 0x8968
271 #endif
272 #ifndef GL_SWIZZLE_STR_ATI
273 #define GL_SWIZZLE_STR_ATI 0x8976
274 #endif
275 #ifndef GL_4X_BIT_ATI
276 #define GL_4X_BIT_ATI 2
277 #endif
278 #ifndef GL_8X_BIT_ATI
279 #define GL_8X_BIT_ATI 4
280 #endif
281 #ifndef GL_BIAS_BIT_ATI
282 #define GL_BIAS_BIT_ATI 8
283 #endif
284 #ifndef GL_MAX_TEXTURE_UNITS
285 #define GL_MAX_TEXTURE_UNITS 0x84E2
286 #endif
287 #ifndef GL_TEXTURE0
288 #define GL_TEXTURE0 0x84C0
289 #endif
290 #ifndef GL_TEXTURE1
291 #define GL_TEXTURE1 0x84C1
292 #endif
293 #ifndef GL_TEXTURE2
294 #define GL_TEXTURE2 0x84C2
295 #endif
296 #ifndef GL_TEXTURE3
297 #define GL_TEXTURE3 0x84C3
298 #endif
299 #ifndef GL_TEXTURE_RECTANGLE
300 #define GL_TEXTURE_RECTANGLE 0x84F5
301 #endif
302 #ifndef GL_PIXEL_UNPACK_BUFFER
303 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
304 #endif
305 #ifndef GL_STREAM_DRAW
306 #define GL_STREAM_DRAW 0x88E0
307 #endif
308 #ifndef GL_DYNAMIC_DRAW
309 #define GL_DYNAMIC_DRAW 0x88E8
310 #endif
311 #ifndef GL_READ_ONLY
312 #define GL_READ_ONLY 0x88B8
313 #endif
314 #ifndef GL_WRITE_ONLY
315 #define GL_WRITE_ONLY 0x88B9
316 #endif
317 #ifndef GL_READ_WRITE
318 #define GL_READ_WRITE 0x88BA
319 #endif
320 #ifndef GL_MAP_READ_BIT
321 #define GL_MAP_READ_BIT 0x0001
322 #endif
323 #ifndef GL_MAP_WRITE_BIT
324 #define GL_MAP_WRITE_BIT 0x0002
325 #endif
326 #ifndef GL_MAP_INVALIDATE_RANGE_BIT
327 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
328 #endif
329 #ifndef GL_MAP_INVALIDATE_BUFFER_BIT
330 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
331 #endif
332 #ifndef GL_MAP_FLUSH_EXPLICIT_BIT
333 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
334 #endif
335 #ifndef GL_MAP_UNSYNCHRONIZED_BIT
336 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
337 #endif
338 #ifndef GL_BGR
339 #define GL_BGR 0x80E0
340 #endif
341 #ifndef GL_BGRA
342 #define GL_BGRA 0x80E1
343 #endif
344 #ifndef GL_UNSIGNED_BYTE_3_3_2
345 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
346 #endif
347 #ifndef GL_UNSIGNED_BYTE_2_3_3_REV
348 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
349 #endif
350 #ifndef GL_UNSIGNED_SHORT_4_4_4_4
351 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
352 #endif
353 #ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV
354 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
355 #endif
356 #ifndef GL_UNSIGNED_SHORT_5_6_5
357 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
358 #endif
359 #ifndef GL_UNSIGNED_INT_8_8_8_8
360 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
361 #endif
362 #ifndef GL_UNSIGNED_INT_8_8_8_8_REV
363 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
364 #endif
365 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV
366 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
367 #endif
368 #ifndef GL_UNSIGNED_INT_10_10_10_2
369 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
370 #endif
371 #ifndef GL_UNSIGNED_INT_2_10_10_10_REV
372 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
373 #endif
374 #ifndef GL_UNSIGNED_SHORT_5_5_5_1
375 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
376 #endif
377 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
378 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
379 #endif
380 #ifndef GL_UNSIGNED_SHORT_8_8
381 #define GL_UNSIGNED_SHORT_8_8 0x85BA
382 #endif
383 #ifndef GL_UNSIGNED_SHORT_8_8_REV
384 #define GL_UNSIGNED_SHORT_8_8_REV 0x85BB
385 #endif
386 #ifndef GL_YCBCR_422_APPLE
387 #define GL_YCBCR_422_APPLE 0x85B9
388 #endif
389 #ifndef GL_YCBCR_MESA
390 #define GL_YCBCR_MESA 0x8757
391 #endif
392 #ifndef GL_RGB32F
393 #define GL_RGB32F 0x8815
394 #endif
395 #ifndef GL_FLOAT_RGB32_NV
396 #define GL_FLOAT_RGB32_NV 0x8889
397 #endif
398 #ifndef GL_LUMINANCE16
399 #define GL_LUMINANCE16 0x8042
400 #endif
401 #ifndef GL_DEPTH_COMPONENT
402 #define GL_DEPTH_COMPONENT 0x1902
403 #endif
404 #ifndef GL_DEPTH_COMPONENT16
405 #define GL_DEPTH_COMPONENT16 0x81A5
406 #endif
407 #ifndef GL_TEXTURE_LUMINANCE_SIZE
408 #define GL_TEXTURE_LUMINANCE_SIZE 0x8060
409 #endif
410 #ifndef GL_DEPTH_TEXTURE_MODE
411 #define GL_DEPTH_TEXTURE_MODE 0x884B
412 #endif
413 #ifndef GL_TEXTURE_COMPARE_MODE
414 #define GL_TEXTURE_COMPARE_MODE 0x884C
415 #endif
416 #ifndef GL_UNPACK_CLIENT_STORAGE_APPLE
417 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
418 #endif
419 #ifndef GL_TEXTURE_STORAGE_HINT_APPLE
420 #define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
421 #endif
422 #ifndef GL_STORAGE_CACHED_APPLE
423 #define GL_STORAGE_CACHED_APPLE 0x85BE
424 #endif
425 #ifndef GL_FRAGMENT_PROGRAM
426 #define GL_FRAGMENT_PROGRAM 0x8804
427 #endif
428 #ifndef GL_PROGRAM_FORMAT_ASCII
429 #define GL_PROGRAM_FORMAT_ASCII 0x8875
430 #endif
431 #ifndef GL_PROGRAM_ERROR_POSITION
432 #define GL_PROGRAM_ERROR_POSITION 0x864B
433 #endif
434 #ifndef GL_MAX_TEXTURE_IMAGE_UNITS
435 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
436 #endif
437 #ifndef GL_PROGRAM_ERROR_STRING
438 #define GL_PROGRAM_ERROR_STRING 0x8874
439 #endif
440 #ifndef GL_FRAGMENT_SHADER
441 #define GL_FRAGMENT_SHADER 0x8B30
442 #endif
443 #ifndef GL_VERTEX_SHADER
444 #define GL_VERTEX_SHADER 0x8B31
445 #endif
446 #ifndef GL_SHADER_TYPE
447 #define GL_SHADER_TYPE 0x8B4F
448 #endif
449 #ifndef GL_COMPILE_STATUS
450 #define GL_COMPILE_STATUS 0x8B81
451 #endif
452 #ifndef GL_LINK_STATUS
453 #define GL_LINK_STATUS 0x8B82
454 #endif
455 /** \} */ // end of glextdefines group
456 
457 #endif /* MPLAYER_GL_COMPAT_H */
458