1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved.
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Public Chromium exports.
|
---|
9 | * Parallel Chromium applications will include this header.
|
---|
10 | */
|
---|
11 |
|
---|
12 |
|
---|
13 | #ifndef __CHROMIUM_H__
|
---|
14 | #define __CHROMIUM_H__
|
---|
15 |
|
---|
16 |
|
---|
17 | /**********************************************************************/
|
---|
18 | /***** System includes and other cruft *****/
|
---|
19 | /**********************************************************************/
|
---|
20 |
|
---|
21 | #include "cr_compiler.h"
|
---|
22 |
|
---|
23 | #ifdef IN_RING0
|
---|
24 | #include <common/VBoxMPUtils.h>
|
---|
25 | #define WINGDIAPI
|
---|
26 | #endif
|
---|
27 | /*
|
---|
28 | * We effectively wrap gl.h, glu.h, etc, just like GLUT
|
---|
29 | */
|
---|
30 |
|
---|
31 | #ifndef GL_GLEXT_PROTOTYPES
|
---|
32 | #define GL_GLEXT_PROTOTYPES
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | #if defined(WINDOWS)
|
---|
36 | # ifdef IN_RING0
|
---|
37 | # error "should not happen!"
|
---|
38 | # endif
|
---|
39 | #define WIN32_LEAN_AND_MEAN
|
---|
40 | #define WGL_APIENTRY __stdcall
|
---|
41 | #include <windows.h>
|
---|
42 | #elif defined(DARWIN)
|
---|
43 | /* nothing */
|
---|
44 | #else
|
---|
45 | # ifndef IN_RING0
|
---|
46 | # define GLX
|
---|
47 | # endif
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | #include <GL/gl.h>
|
---|
51 |
|
---|
52 | #ifndef WINDOWS
|
---|
53 | #include <GL/glu.h>
|
---|
54 | #endif
|
---|
55 |
|
---|
56 |
|
---|
57 | #ifdef GLX
|
---|
58 | #ifndef GLX_GLXEXT_PROTOTYPES
|
---|
59 | #define GLX_GLXEXT_PROTOTYPES
|
---|
60 | #endif
|
---|
61 | #include <GL/glx.h>
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #ifdef USE_OSMESA
|
---|
65 | #include <GL/osmesa.h>
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | #ifdef DARWIN
|
---|
69 | #include <stddef.h>
|
---|
70 | #elif !defined(FreeBSD)
|
---|
71 | #include <malloc.h> /* to get ptrdiff_t used below */
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | #include <GL/glext.h>
|
---|
75 |
|
---|
76 | #ifdef __cplusplus
|
---|
77 | extern "C" {
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | /* to shut up gcc warning for struct VBOXUHGSMI * parameters */
|
---|
81 | struct VBOXUHGSMI;
|
---|
82 | struct VBOXVR_SCR_COMPOSITOR;
|
---|
83 | struct VBOXVR_SCR_COMPOSITOR_ENTRY;
|
---|
84 |
|
---|
85 | #define CR_RENDER_DEFAULT_CONTEXT_ID (INT32_MAX-1)
|
---|
86 | #define CR_RENDER_DEFAULT_WINDOW_ID (INT32_MAX-1)
|
---|
87 |
|
---|
88 | #if defined(IN_GUEST) && (WINDOWS) && defined(VBOX_WITH_WDDM)
|
---|
89 | # ifdef VBOX_WDDM_WOW64
|
---|
90 | # define VBOX_MODNAME_DISPD3D "VBoxDispD3D-x86"
|
---|
91 | # else
|
---|
92 | # define VBOX_MODNAME_DISPD3D "VBoxDispD3D"
|
---|
93 | # endif
|
---|
94 | #endif
|
---|
95 |
|
---|
96 | #ifndef APIENTRY
|
---|
97 | #define APIENTRY
|
---|
98 | #endif
|
---|
99 |
|
---|
100 |
|
---|
101 | /**********************************************************************/
|
---|
102 | /***** Define things that might have been missing in gl.h *****/
|
---|
103 | /**********************************************************************/
|
---|
104 |
|
---|
105 | /*
|
---|
106 | * Define missing GLX tokens:
|
---|
107 | */
|
---|
108 |
|
---|
109 | #ifndef GLX_SAMPLE_BUFFERS_SGIS
|
---|
110 | #define GLX_SAMPLE_BUFFERS_SGIS 0x186a0 /*100000*/
|
---|
111 | #endif
|
---|
112 | #ifndef GLX_SAMPLES_SGIS
|
---|
113 | #define GLX_SAMPLES_SGIS 0x186a1 /*100001*/
|
---|
114 | #endif
|
---|
115 | #ifndef GLX_VISUAL_CAVEAT_EXT
|
---|
116 | #define GLX_VISUAL_CAVEAT_EXT 0x20 /* visual_rating extension type */
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | /*
|
---|
120 | * Define missing WGL tokens:
|
---|
121 | */
|
---|
122 | #ifndef WGL_COLOR_BITS_EXT
|
---|
123 | #define WGL_COLOR_BITS_EXT 0x2014
|
---|
124 | #endif
|
---|
125 | #ifndef WGL_DRAW_TO_WINDOW_EXT
|
---|
126 | #define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
---|
127 | #endif
|
---|
128 | #ifndef WGL_FULL_ACCELERATION_EXT
|
---|
129 | #define WGL_FULL_ACCELERATION_EXT 0x2027
|
---|
130 | #endif
|
---|
131 | #ifndef WGL_ACCELERATION_EXT
|
---|
132 | #define WGL_ACCELERATION_EXT 0x2003
|
---|
133 | #endif
|
---|
134 | #ifndef WGL_TYPE_RGBA_EXT
|
---|
135 | #define WGL_TYPE_RGBA_EXT 0x202B
|
---|
136 | #endif
|
---|
137 | #ifndef WGL_RED_BITS_EXT
|
---|
138 | #define WGL_RED_BITS_EXT 0x2015
|
---|
139 | #endif
|
---|
140 | #ifndef WGL_GREEN_BITS_EXT
|
---|
141 | #define WGL_GREEN_BITS_EXT 0x2017
|
---|
142 | #endif
|
---|
143 | #ifndef WGL_BLUE_BITS_EXT
|
---|
144 | #define WGL_BLUE_BITS_EXT 0x2019
|
---|
145 | #endif
|
---|
146 | #ifndef WGL_ALPHA_BITS_EXT
|
---|
147 | #define WGL_ALPHA_BITS_EXT 0x201B
|
---|
148 | #endif
|
---|
149 | #ifndef WGL_DOUBLE_BUFFER_EXT
|
---|
150 | #define WGL_DOUBLE_BUFFER_EXT 0x2011
|
---|
151 | #endif
|
---|
152 | #ifndef WGL_STEREO_EXT
|
---|
153 | #define WGL_STEREO_EXT 0x2012
|
---|
154 | #endif
|
---|
155 | #ifndef WGL_ACCUM_RED_BITS_EXT
|
---|
156 | #define WGL_ACCUM_RED_BITS_EXT 0x201E
|
---|
157 | #endif
|
---|
158 | #ifndef WGL_ACCUM_GREEN_BITS_EXT
|
---|
159 | #define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
---|
160 | #endif
|
---|
161 | #ifndef WGL_ACCUM_BLUE_BITS_EXT
|
---|
162 | #define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
---|
163 | #endif
|
---|
164 | #ifndef WGL_ACCUM_ALPHA_BITS_EXT
|
---|
165 | #define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
---|
166 | #endif
|
---|
167 | #ifndef WGL_DEPTH_BITS_EXT
|
---|
168 | #define WGL_DEPTH_BITS_EXT 0x2022
|
---|
169 | #endif
|
---|
170 | #ifndef WGL_STENCIL_BITS_EXT
|
---|
171 | #define WGL_STENCIL_BITS_EXT 0x2023
|
---|
172 | #endif
|
---|
173 | #ifndef WGL_SAMPLE_BUFFERS_EXT
|
---|
174 | #define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
---|
175 | #endif
|
---|
176 | #ifndef WGL_SAMPLES_EXT
|
---|
177 | #define WGL_SAMPLES_EXT 0x2042
|
---|
178 | #endif
|
---|
179 | #ifndef WGL_SUPPORT_OPENGL_ARB
|
---|
180 | #define WGL_SUPPORT_OPENGL_ARB 0x2010
|
---|
181 | #endif
|
---|
182 | #ifndef WGL_NUMBER_PIXEL_FORMATS_ARB
|
---|
183 | #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
---|
184 | #endif
|
---|
185 | #ifndef WGL_FULL_ACCELERATION_ARB
|
---|
186 | #define WGL_FULL_ACCELERATION_ARB 0x2027
|
---|
187 | #endif
|
---|
188 | #ifndef WGL_SWAP_UNDEFINED_ARB
|
---|
189 | #define WGL_SWAP_UNDEFINED_ARB 0x202A
|
---|
190 | #endif
|
---|
191 | #ifndef WGL_TYPE_RGBA_ARB
|
---|
192 | #define WGL_TYPE_RGBA_ARB 0x202B
|
---|
193 | #endif
|
---|
194 | #ifndef WGL_DRAW_TO_WINDOW_ARB
|
---|
195 | #define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
---|
196 | #endif
|
---|
197 | #ifndef WGL_DRAW_TO_BITMAP_ARB
|
---|
198 | #define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
---|
199 | #endif
|
---|
200 | #ifndef WGL_DOUBLE_BUFFER_ARB
|
---|
201 | #define WGL_DOUBLE_BUFFER_ARB 0x2011
|
---|
202 | #endif
|
---|
203 | #ifndef WGL_NEED_PALETTE_ARB
|
---|
204 | #define WGL_NEED_PALETTE_ARB 0x2004
|
---|
205 | #endif
|
---|
206 | #ifndef WGL_NEED_SYSTEM_PALETTE_ARB
|
---|
207 | #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
---|
208 | #endif
|
---|
209 | #ifndef WGL_SWAP_LAYER_BUFFERS_ARB
|
---|
210 | #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
---|
211 | #endif
|
---|
212 | #ifndef WGL_NUMBER_OVERLAYS_ARB
|
---|
213 | #define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
---|
214 | #endif
|
---|
215 | #ifndef WGL_NUMBER_UNDERLAYS_ARB
|
---|
216 | #define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
---|
217 | #endif
|
---|
218 | #ifndef WGL_TRANSPARENT_ARB
|
---|
219 | #define WGL_TRANSPARENT_ARB 0x200A
|
---|
220 | #endif
|
---|
221 | #ifndef WGL_TRANSPARENT_RED_VALUE_ARB
|
---|
222 | #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
---|
223 | #endif
|
---|
224 | #ifndef WGL_TRANSPARENT_GREEN_VALUE_ARB
|
---|
225 | #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
---|
226 | #endif
|
---|
227 | #ifndef WGL_TRANSPARENT_BLUE_VALUE_ARB
|
---|
228 | #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
---|
229 | #endif
|
---|
230 | #ifndef WGL_TRANSPARENT_ALPHA_VALUE_ARB
|
---|
231 | #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
---|
232 | #endif
|
---|
233 | #ifndef WGL_TRANSPARENT_INDEX_VALUE_ARB
|
---|
234 | #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
---|
235 | #endif
|
---|
236 | #ifndef WGL_SHARE_STENCIL_ARB
|
---|
237 | #define WGL_SHARE_STENCIL_ARB 0x200D
|
---|
238 | #endif
|
---|
239 | #ifndef WGL_SHARE_ACCUM_ARB
|
---|
240 | #define WGL_SHARE_ACCUM_ARB 0x200E
|
---|
241 | #endif
|
---|
242 | #ifndef WGL_SUPPORT_GDI_ARB
|
---|
243 | #define WGL_SUPPORT_GDI_ARB 0x200F
|
---|
244 | #endif
|
---|
245 | #ifndef WGL_RED_BITS_ARB
|
---|
246 | #define WGL_RED_BITS_ARB 0x2015
|
---|
247 | #endif
|
---|
248 | #ifndef WGL_RED_SHIFT_ARB
|
---|
249 | #define WGL_RED_SHIFT_ARB 0x2016
|
---|
250 | #endif
|
---|
251 | #ifndef WGL_GREEN_BITS_ARB
|
---|
252 | #define WGL_GREEN_BITS_ARB 0x2017
|
---|
253 | #endif
|
---|
254 | #ifndef WGL_GREEN_SHIFT_ARB
|
---|
255 | #define WGL_GREEN_SHIFT_ARB 0x2018
|
---|
256 | #endif
|
---|
257 | #ifndef WGL_BLUE_BITS_ARB
|
---|
258 | #define WGL_BLUE_BITS_ARB 0x2019
|
---|
259 | #endif
|
---|
260 | #ifndef WGL_BLUE_SHIFT_ARB
|
---|
261 | #define WGL_BLUE_SHIFT_ARB 0x201A
|
---|
262 | #endif
|
---|
263 | #ifndef WGL_ALPHA_BITS_ARB
|
---|
264 | #define WGL_ALPHA_BITS_ARB 0x201B
|
---|
265 | #endif
|
---|
266 | #ifndef WGL_ALPHA_SHIFT_ARB
|
---|
267 | #define WGL_ALPHA_SHIFT_ARB 0x201C
|
---|
268 | #endif
|
---|
269 | #ifndef WGL_ACCUM_BITS_ARB
|
---|
270 | #define WGL_ACCUM_BITS_ARB 0x201D
|
---|
271 | #endif
|
---|
272 | #ifndef WGL_ACCUM_RED_BITS_ARB
|
---|
273 | #define WGL_ACCUM_RED_BITS_ARB 0x201E
|
---|
274 | #endif
|
---|
275 | #ifndef WGL_ACCUM_GREEN_BITS_ARB
|
---|
276 | #define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
---|
277 | #endif
|
---|
278 | #ifndef WGL_ACCUM_BLUE_BITS_ARB
|
---|
279 | #define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
---|
280 | #endif
|
---|
281 | #ifndef WGL_ACCUM_ALPHA_BITS_ARB
|
---|
282 | #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
---|
283 | #endif
|
---|
284 | #ifndef WGL_DEPTH_BITS_ARB
|
---|
285 | #define WGL_DEPTH_BITS_ARB 0x2022
|
---|
286 | #endif
|
---|
287 | #ifndef WGL_STENCIL_BITS_ARB
|
---|
288 | #define WGL_STENCIL_BITS_ARB 0x2023
|
---|
289 | #endif
|
---|
290 | #ifndef WGL_AUX_BUFFERS_ARB
|
---|
291 | #define WGL_AUX_BUFFERS_ARB 0x2024
|
---|
292 | #endif
|
---|
293 | #ifndef WGL_STEREO_ARB
|
---|
294 | #define WGL_STEREO_ARB 0x2012
|
---|
295 | #endif
|
---|
296 | #ifndef WGL_ACCELERATION_ARB
|
---|
297 | #define WGL_ACCELERATION_ARB 0x2003
|
---|
298 | #endif
|
---|
299 | #ifndef WGL_SHARE_DEPTH_ARB
|
---|
300 | #define WGL_SHARE_DEPTH_ARB 0x200C
|
---|
301 | #endif
|
---|
302 | #ifndef WGL_PIXEL_TYPE_ARB
|
---|
303 | #define WGL_PIXEL_TYPE_ARB 0x2013
|
---|
304 | #endif
|
---|
305 | #ifndef WGL_COLOR_BITS_ARB
|
---|
306 | #define WGL_COLOR_BITS_ARB 0x2014
|
---|
307 | #endif
|
---|
308 | #ifndef WGL_SWAP_METHOD_ARB
|
---|
309 | #define WGL_SWAP_METHOD_ARB 0x2007
|
---|
310 | #endif
|
---|
311 |
|
---|
312 | /*
|
---|
313 | * Define missing 1.2 tokens:
|
---|
314 | */
|
---|
315 | #ifndef GL_SMOOTH_POINT_SIZE_RANGE
|
---|
316 | #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
|
---|
317 | #endif
|
---|
318 |
|
---|
319 | #ifndef GL_SMOOTH_POINT_SIZE_GRANULARITY
|
---|
320 | #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
|
---|
321 | #endif
|
---|
322 |
|
---|
323 | #ifndef GL_SMOOTH_LINE_WIDTH_RANGE
|
---|
324 | #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
|
---|
325 | #endif
|
---|
326 |
|
---|
327 | #ifndef GL_SMOOTH_LINE_WIDTH_GRANULARITY
|
---|
328 | #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
|
---|
329 | #endif
|
---|
330 |
|
---|
331 | #ifndef GL_ALIASED_POINT_SIZE_RANGE
|
---|
332 | #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
---|
333 | #endif
|
---|
334 |
|
---|
335 | #ifndef GL_ALIASED_LINE_WIDTH_RANGE
|
---|
336 | #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
---|
337 | #endif
|
---|
338 |
|
---|
339 | #ifndef GL_COLOR_MATRIX_STACK_DEPTH
|
---|
340 | #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
|
---|
341 | #endif
|
---|
342 |
|
---|
343 | #ifndef GL_COLOR_MATRIX
|
---|
344 | #define GL_COLOR_MATRIX 0x80B1
|
---|
345 | #endif
|
---|
346 |
|
---|
347 | #ifndef GL_TEXTURE_3D
|
---|
348 | #define GL_TEXTURE_3D 0x806F
|
---|
349 | #endif
|
---|
350 |
|
---|
351 | #ifndef GL_MAX_3D_TEXTURE_SIZE
|
---|
352 | #define GL_MAX_3D_TEXTURE_SIZE 0x8073
|
---|
353 | #endif
|
---|
354 |
|
---|
355 | #ifndef GL_PACK_SKIP_IMAGES
|
---|
356 | #define GL_PACK_SKIP_IMAGES 0x806B
|
---|
357 | #endif
|
---|
358 |
|
---|
359 | #ifndef GL_PACK_IMAGE_HEIGHT
|
---|
360 | #define GL_PACK_IMAGE_HEIGHT 0x806C
|
---|
361 | #endif
|
---|
362 |
|
---|
363 | #ifndef GL_UNPACK_SKIP_IMAGES
|
---|
364 | #define GL_UNPACK_SKIP_IMAGES 0x806D
|
---|
365 | #endif
|
---|
366 |
|
---|
367 | #ifndef GL_UNPACK_IMAGE_HEIGHT
|
---|
368 | #define GL_UNPACK_IMAGE_HEIGHT 0x806E
|
---|
369 | #endif
|
---|
370 |
|
---|
371 | #ifndef GL_PROXY_TEXTURE_3D
|
---|
372 | #define GL_PROXY_TEXTURE_3D 0x8070
|
---|
373 | #endif
|
---|
374 |
|
---|
375 | #ifndef GL_TEXTURE_DEPTH
|
---|
376 | #define GL_TEXTURE_DEPTH 0x8071
|
---|
377 | #endif
|
---|
378 |
|
---|
379 | #ifndef GL_TEXTURE_WRAP_R
|
---|
380 | #define GL_TEXTURE_WRAP_R 0x8072
|
---|
381 | #endif
|
---|
382 |
|
---|
383 | #ifndef GL_TEXTURE_BINDING_3D
|
---|
384 | #define GL_TEXTURE_BINDING_3D 0x806A
|
---|
385 | #endif
|
---|
386 |
|
---|
387 | #ifndef GL_MAX_ELEMENTS_VERTICES
|
---|
388 | #define GL_MAX_ELEMENTS_VERTICES 0x80E8
|
---|
389 | #endif
|
---|
390 |
|
---|
391 | #ifndef GL_MAX_ELEMENTS_INDICES
|
---|
392 | #define GL_MAX_ELEMENTS_INDICES 0x80E9
|
---|
393 | #endif
|
---|
394 |
|
---|
395 |
|
---|
396 | /*
|
---|
397 | * Define missing ARB_imaging tokens
|
---|
398 | */
|
---|
399 |
|
---|
400 | #ifndef GL_BLEND_EQUATION
|
---|
401 | #define GL_BLEND_EQUATION 0x8009
|
---|
402 | #endif
|
---|
403 |
|
---|
404 | #ifndef GL_MIN
|
---|
405 | #define GL_MIN 0x8007
|
---|
406 | #endif
|
---|
407 |
|
---|
408 | #ifndef GL_MAX
|
---|
409 | #define GL_MAX 0x8008
|
---|
410 | #endif
|
---|
411 |
|
---|
412 | #ifndef GL_FUNC_ADD
|
---|
413 | #define GL_FUNC_ADD 0x8006
|
---|
414 | #endif
|
---|
415 |
|
---|
416 | #ifndef GL_FUNC_SUBTRACT
|
---|
417 | #define GL_FUNC_SUBTRACT 0x800A
|
---|
418 | #endif
|
---|
419 |
|
---|
420 | #ifndef GL_FUNC_REVERSE_SUBTRACT
|
---|
421 | #define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
---|
422 | #endif
|
---|
423 |
|
---|
424 | #ifndef GL_BLEND_COLOR
|
---|
425 | #define GL_BLEND_COLOR 0x8005
|
---|
426 | #endif
|
---|
427 |
|
---|
428 | #ifndef GL_PER_STAGE_CONSTANTS_NV
|
---|
429 | #define GL_PER_STAGE_CONSTANTS_NV 0x8535
|
---|
430 | #endif
|
---|
431 |
|
---|
432 | #ifndef GL_FOG_COORDINATE_ARRAY_POINTER_EXT
|
---|
433 | #define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
|
---|
434 | #endif
|
---|
435 |
|
---|
436 | typedef void (*CR_GLXFuncPtr)();
|
---|
437 | #ifndef GLX_ARB_get_proc_address
|
---|
438 | #define GLX_ARB_get_proc_address 1
|
---|
439 | CR_GLXFuncPtr glXGetProcAddressARB( const GLubyte *name );
|
---|
440 | #endif /* GLX_ARB_get_proc_address */
|
---|
441 |
|
---|
442 | #ifndef GLX_VERSION_1_4
|
---|
443 | CR_GLXFuncPtr glXGetProcAddress( const GLubyte *name );
|
---|
444 | #endif /* GLX_ARB_get_proc_address */
|
---|
445 |
|
---|
446 | #ifndef GL_RASTER_POSITION_UNCLIPPED_IBM
|
---|
447 | #define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
|
---|
448 | #endif
|
---|
449 |
|
---|
450 | #ifdef WINDOWS
|
---|
451 | /* XXX how about this prototype for wglGetProcAddress()?
|
---|
452 | PROC WINAPI wglGetProcAddress_prox( LPCSTR name )
|
---|
453 | */
|
---|
454 | #endif
|
---|
455 |
|
---|
456 |
|
---|
457 | #ifndef GL_VERSION_1_5
|
---|
458 |
|
---|
459 | typedef ptrdiff_t GLintptr;
|
---|
460 | typedef ptrdiff_t GLsizeiptr;
|
---|
461 |
|
---|
462 | /* prototype these functions for opengl_stub/getprocaddress.c */
|
---|
463 | extern void APIENTRY glGenQueries(GLsizei n, GLuint *ids);
|
---|
464 | extern void APIENTRY glDeleteQueries(GLsizei n, const GLuint *ids);
|
---|
465 | extern GLboolean APIENTRY glIsQuery(GLuint id);
|
---|
466 | extern void APIENTRY glBeginQuery(GLenum target, GLuint id);
|
---|
467 | extern void APIENTRY glEndQuery(GLenum target);
|
---|
468 | extern void APIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint *params);
|
---|
469 | extern void APIENTRY glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params);
|
---|
470 | extern void APIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params);
|
---|
471 | extern void APIENTRY glBindBuffer(GLenum, GLuint);
|
---|
472 | extern void APIENTRY glDeleteBuffers(GLsizei, const GLuint *);
|
---|
473 | extern void APIENTRY glGenBuffers(GLsizei, GLuint *);
|
---|
474 | extern GLboolean APIENTRY glIsBuffer(GLuint);
|
---|
475 | extern void APIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum);
|
---|
476 | extern void APIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *);
|
---|
477 | extern void APIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *);
|
---|
478 | extern GLvoid* APIENTRY glMapBuffer(GLenum, GLenum);
|
---|
479 | extern GLboolean APIENTRY glUnmapBuffer(GLenum);
|
---|
480 | extern void APIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *);
|
---|
481 | extern void APIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *);
|
---|
482 |
|
---|
483 | #endif
|
---|
484 |
|
---|
485 |
|
---|
486 | /**********************************************************************/
|
---|
487 | /***** Chromium Extensions to OpenGL *****/
|
---|
488 | /***** *****/
|
---|
489 | /***** Chromium owns the OpenGL enum range 0x8AF0-0x8B2F *****/
|
---|
490 | /**********************************************************************/
|
---|
491 |
|
---|
492 | #ifndef GL_CR_synchronization
|
---|
493 | #define GL_CR_synchronization 1
|
---|
494 |
|
---|
495 | typedef void (APIENTRY *glBarrierCreateCRProc) (GLuint name, GLuint count);
|
---|
496 | typedef void (APIENTRY *glBarrierDestroyCRProc) (GLuint name);
|
---|
497 | typedef void (APIENTRY *glBarrierExecCRProc) (GLuint name);
|
---|
498 | typedef void (APIENTRY *glSemaphoreCreateCRProc) (GLuint name, GLuint count);
|
---|
499 | typedef void (APIENTRY *glSemaphoreDestroyCRProc) (GLuint name);
|
---|
500 | typedef void (APIENTRY *glSemaphorePCRProc) (GLuint name);
|
---|
501 | typedef void (APIENTRY *glSemaphoreVCRProc) (GLuint name);
|
---|
502 |
|
---|
503 | extern void APIENTRY glBarrierCreateCR(GLuint name, GLuint count);
|
---|
504 | extern void APIENTRY glBarrierDestroyCR(GLuint name);
|
---|
505 | extern void APIENTRY glBarrierExecCR(GLuint name);
|
---|
506 | extern void APIENTRY glSemaphoreCreateCR(GLuint name, GLuint count);
|
---|
507 | extern void APIENTRY glSemaphoreDestroyCR(GLuint name);
|
---|
508 | extern void APIENTRY glSemaphorePCR(GLuint name);
|
---|
509 | extern void APIENTRY glSemaphoreVCR(GLuint name);
|
---|
510 |
|
---|
511 | #endif /* GL_CR_synchronization */
|
---|
512 |
|
---|
513 |
|
---|
514 | #ifndef GL_CR_bounds_info
|
---|
515 | #define GL_CR_bounds_info 1
|
---|
516 | /* Private, internal Chromium function */
|
---|
517 | /*
|
---|
518 | typedef void (APIENTRY *glBoundsInfoCRProc)(const CRrecti *, const GLbyte *, GLint, GLint);
|
---|
519 | */
|
---|
520 | #endif /* GL_CR_bounds_info */
|
---|
521 |
|
---|
522 |
|
---|
523 | #ifndef GL_CR_state_parameter
|
---|
524 | #define GL_CR_state_parameter 1
|
---|
525 |
|
---|
526 | typedef void (APIENTRY *glChromiumParameteriCRProc) (GLenum target, GLint value);
|
---|
527 | typedef void (APIENTRY *glChromiumParameterfCRProc) (GLenum target, GLfloat value);
|
---|
528 | typedef void (APIENTRY *glChromiumParametervCRProc) (GLenum target, GLenum type, GLsizei count, const GLvoid *values);
|
---|
529 | typedef void (APIENTRY *glGetChromiumParametervCRProc) (GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values);
|
---|
530 |
|
---|
531 | extern void APIENTRY glChromiumParameteriCR(GLenum target, GLint value);
|
---|
532 | extern void APIENTRY glChromiumParameterfCR(GLenum target, GLfloat value);
|
---|
533 | extern void APIENTRY glChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values);
|
---|
534 | extern void APIENTRY glGetChromiumParametervCR(GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values);
|
---|
535 |
|
---|
536 |
|
---|
537 | #endif /* GL_CR_state_parameter */
|
---|
538 |
|
---|
539 |
|
---|
540 | #ifndef GL_CR_cursor_position
|
---|
541 | #define GL_CR_cursor_position 1
|
---|
542 | /* For virtual cursor feature (show_cursor) */
|
---|
543 |
|
---|
544 | #define GL_CURSOR_POSITION_CR 0x8AF0
|
---|
545 |
|
---|
546 | #endif /* GL_CR_cursor_position */
|
---|
547 |
|
---|
548 |
|
---|
549 | #ifndef GL_CR_bounding_box
|
---|
550 | #define GL_CR_bounding_box 1
|
---|
551 | /* To set bounding box from client app */
|
---|
552 |
|
---|
553 | #define GL_DEFAULT_BBOX_CR 0x8AF1
|
---|
554 | #define GL_SCREEN_BBOX_CR 0x8AF2
|
---|
555 | #define GL_OBJECT_BBOX_CR 0x8AF3
|
---|
556 |
|
---|
557 | #endif /* GL_CR_bounding_box */
|
---|
558 |
|
---|
559 |
|
---|
560 | #ifndef GL_CR_print_string
|
---|
561 | #define GL_CR_print_string 1
|
---|
562 | /* To print a string to stdout */
|
---|
563 | #define GL_PRINT_STRING_CR 0x8AF4
|
---|
564 |
|
---|
565 | #endif /* GL_CR_print_string */
|
---|
566 |
|
---|
567 |
|
---|
568 | #ifndef GL_CR_tilesort_info
|
---|
569 | #define GL_CR_tilesort_info 1
|
---|
570 | /* To query tilesort information */
|
---|
571 |
|
---|
572 | #define GL_MURAL_SIZE_CR 0x8AF5
|
---|
573 | #define GL_NUM_SERVERS_CR 0x8AF6
|
---|
574 | #define GL_NUM_TILES_CR 0x8AF7
|
---|
575 | #define GL_TILE_BOUNDS_CR 0x8AF8
|
---|
576 | #define GL_VERTEX_COUNTS_CR 0x8AF9
|
---|
577 | #define GL_RESET_VERTEX_COUNTERS_CR 0x8AFA
|
---|
578 | #define GL_SET_MAX_VIEWPORT_CR 0x8AFB
|
---|
579 |
|
---|
580 | #endif /* GL_CR_tilesort_info */
|
---|
581 |
|
---|
582 |
|
---|
583 | #ifndef GL_CR_head_spu_name
|
---|
584 | #define GL_CR_head_spu_name 1
|
---|
585 | /* To fetch name of first SPU on a node */
|
---|
586 |
|
---|
587 | #define GL_HEAD_SPU_NAME_CR 0x8AFC
|
---|
588 |
|
---|
589 | #endif /* GL_CR_head_spu_name */
|
---|
590 |
|
---|
591 |
|
---|
592 | #ifndef GL_CR_performance_info
|
---|
593 | #define GL_CR_performance_info 1
|
---|
594 | /* For gathering performance metrics */
|
---|
595 |
|
---|
596 | #define GL_PERF_GET_FRAME_DATA_CR 0x8AFD
|
---|
597 | #define GL_PERF_GET_TIMER_DATA_CR 0x8AFE
|
---|
598 | #define GL_PERF_DUMP_COUNTERS_CR 0x8AFF
|
---|
599 | #define GL_PERF_SET_TOKEN_CR 0x8B00
|
---|
600 | #define GL_PERF_SET_DUMP_ON_SWAP_CR 0x8B01
|
---|
601 | #define GL_PERF_SET_DUMP_ON_FINISH_CR 0x8B02
|
---|
602 | #define GL_PERF_SET_DUMP_ON_FLUSH_CR 0x8B03
|
---|
603 | #define GL_PERF_START_TIMER_CR 0x8B04
|
---|
604 | #define GL_PERF_STOP_TIMER_CR 0x8B05
|
---|
605 |
|
---|
606 | #endif /* GL_CR_performance_info */
|
---|
607 |
|
---|
608 |
|
---|
609 | #ifndef GL_CR_window_size
|
---|
610 | #define GL_CR_window_size 1
|
---|
611 | /* To communicate window size changes */
|
---|
612 |
|
---|
613 | #define GL_WINDOW_SIZE_CR 0x8B06
|
---|
614 | #define GL_MAX_WINDOW_SIZE_CR 0x8B24 /* new */
|
---|
615 | #define GL_WINDOW_VISIBILITY_CR 0x8B25 /* new */
|
---|
616 |
|
---|
617 | #endif /* GL_CR_window_size */
|
---|
618 |
|
---|
619 |
|
---|
620 | #ifndef GL_CR_tile_info
|
---|
621 | #define GL_CR_tile_info 1
|
---|
622 | /* To send new tile information to a server */
|
---|
623 |
|
---|
624 | #define GL_TILE_INFO_CR 0x8B07
|
---|
625 |
|
---|
626 | #endif /* GL_CR_tile_info */
|
---|
627 |
|
---|
628 |
|
---|
629 | #ifndef GL_CR_gather
|
---|
630 | #define GL_CR_gather 1
|
---|
631 | /* For aggregate transfers */
|
---|
632 |
|
---|
633 | #define GL_GATHER_DRAWPIXELS_CR 0x8B08
|
---|
634 | #define GL_GATHER_PACK_CR 0x8B09
|
---|
635 | #define GL_GATHER_CONNECT_CR 0x8B0A
|
---|
636 | #define GL_GATHER_POST_SWAPBUFFERS_CR 0x8B0B
|
---|
637 |
|
---|
638 | #endif /* GL_CR_gather */
|
---|
639 |
|
---|
640 |
|
---|
641 | #ifndef GL_CR_saveframe
|
---|
642 | #define GL_CR_saveframe 1
|
---|
643 |
|
---|
644 | #define GL_SAVEFRAME_ENABLED_CR 0x8B0C
|
---|
645 | #define GL_SAVEFRAME_FRAMENUM_CR 0x8B0D
|
---|
646 | #define GL_SAVEFRAME_STRIDE_CR 0x8B0E
|
---|
647 | #define GL_SAVEFRAME_SINGLE_CR 0x8B0F
|
---|
648 | #define GL_SAVEFRAME_FILESPEC_CR 0x8B10
|
---|
649 |
|
---|
650 | #endif /* GL_CR_saveframe */
|
---|
651 |
|
---|
652 |
|
---|
653 | #ifndef GL_CR_readback_barrier_size
|
---|
654 | #define GL_CR_readback_barrier_size 1
|
---|
655 |
|
---|
656 | #define GL_READBACK_BARRIER_SIZE_CR 0x8B11
|
---|
657 |
|
---|
658 | #endif /* GL_CR_readback_barrier_size */
|
---|
659 |
|
---|
660 |
|
---|
661 | #ifndef GL_CR_server_id_sharing
|
---|
662 | #define GL_CR_server_id_sharing 1
|
---|
663 |
|
---|
664 | #define GL_SHARED_DISPLAY_LISTS_CR 0x8B12
|
---|
665 | #define GL_SHARED_TEXTURE_OBJECTS_CR 0x8B13
|
---|
666 | #define GL_SHARED_PROGRAMS_CR 0x8B14
|
---|
667 |
|
---|
668 | #endif /* GL_CR_server_id_sharing */
|
---|
669 |
|
---|
670 |
|
---|
671 | #ifndef GL_CR_server_matrix
|
---|
672 | #define GL_CR_server_matrix 1
|
---|
673 |
|
---|
674 | #define GL_SERVER_VIEW_MATRIX_CR 0x8B15
|
---|
675 | #define GL_SERVER_PROJECTION_MATRIX_CR 0x8B16
|
---|
676 | #define GL_SERVER_FRUSTUM_CR 0x8B17
|
---|
677 | #define GL_SERVER_CURRENT_EYE_CR 0x8B18
|
---|
678 |
|
---|
679 | #endif /* GL_CR_server_matrix */
|
---|
680 |
|
---|
681 |
|
---|
682 | #ifndef GL_CR_window_position
|
---|
683 | #define GL_CR_window_position 1
|
---|
684 |
|
---|
685 | #define GL_WINDOW_POSITION_CR 0x8B19
|
---|
686 |
|
---|
687 | #endif /* GL_CR_window_position */
|
---|
688 |
|
---|
689 |
|
---|
690 | #ifndef GL_CR_zpix
|
---|
691 | #define GL_CR_zpix 1
|
---|
692 |
|
---|
693 | #define GL_ZLIB_COMPRESSION_CR 0x8B20
|
---|
694 | #define GL_RLE_COMPRESSION_CR 0x8B21
|
---|
695 | #define GL_PLE_COMPRESSION_CR 0x8B22
|
---|
696 |
|
---|
697 | /* XXX A better name would be glCompressedDrawPixelsCR() */
|
---|
698 | extern void APIENTRY glZPixCR(GLsizei width, GLsizei height, GLenum format,
|
---|
699 | GLenum type, GLenum compressionType,
|
---|
700 | GLint client, GLint compressedSize,
|
---|
701 | const GLvoid *image);
|
---|
702 |
|
---|
703 | #endif /* GL_CR_zpix */
|
---|
704 |
|
---|
705 | /*Allow to use glGetString to query real host GPU info*/
|
---|
706 | #ifndef GL_CR_real_vendor_strings
|
---|
707 | #define GL_CR_real_vendor_strings 1
|
---|
708 | #define GL_REAL_VENDOR 0x8B23
|
---|
709 | #define GL_REAL_VERSION 0x8B24
|
---|
710 | #define GL_REAL_RENDERER 0x8B25
|
---|
711 | #define GL_REAL_EXTENSIONS 0x8B26
|
---|
712 | #endif
|
---|
713 |
|
---|
714 | /*Global resource ids sharing*/
|
---|
715 | #define GL_SHARE_CONTEXT_RESOURCES_CR 0x8B27
|
---|
716 | /*do flush for the command buffer of a thread the context was previusly current for*/
|
---|
717 | #define GL_FLUSH_ON_THREAD_SWITCH_CR 0x8B28
|
---|
718 | /*report that the shared resource is used by this context, the parameter value is a texture name*/
|
---|
719 | #define GL_RCUSAGE_TEXTURE_SET_CR 0x8B29
|
---|
720 | /*report that the shared resource is no longer used by this context, the parameter value is a texture name*/
|
---|
721 | #define GL_RCUSAGE_TEXTURE_CLEAR_CR 0x8B2A
|
---|
722 | /*configures host to create windows initially hidden*/
|
---|
723 | #define GL_HOST_WND_CREATED_HIDDEN_CR 0x8B2B
|
---|
724 | /* guest requests host whether e debug break is needed*/
|
---|
725 | #define GL_DBG_CHECK_BREAK_CR 0x8B2C
|
---|
726 | /* Tells renderspu the default context id being used by the crserver */
|
---|
727 | #define GL_HH_SET_DEFAULT_SHARED_CTX 0x8B2D
|
---|
728 |
|
---|
729 | /**********************************************************************/
|
---|
730 | /***** Chromium-specific API *****/
|
---|
731 | /**********************************************************************/
|
---|
732 |
|
---|
733 |
|
---|
734 | /*
|
---|
735 | * Accepted by crCreateContext() and crCreateWindow() visBits parameter.
|
---|
736 | * Used to communicate visual attributes throughout Chromium.
|
---|
737 | */
|
---|
738 | #define CR_RGB_BIT 0x1
|
---|
739 | #define CR_ALPHA_BIT 0x2
|
---|
740 | #define CR_DEPTH_BIT 0x4
|
---|
741 | #define CR_STENCIL_BIT 0x8
|
---|
742 | #define CR_ACCUM_BIT 0x10
|
---|
743 | #define CR_DOUBLE_BIT 0x20
|
---|
744 | #define CR_STEREO_BIT 0x40
|
---|
745 | #define CR_MULTISAMPLE_BIT 0x80
|
---|
746 | #define CR_OVERLAY_BIT 0x100
|
---|
747 | #define CR_PBUFFER_BIT 0x200
|
---|
748 | #define CR_ALL_BITS 0x3ff
|
---|
749 |
|
---|
750 |
|
---|
751 | /* Accepted by crSwapBuffers() flag parameter */
|
---|
752 | #define CR_SUPPRESS_SWAP_BIT 0x1
|
---|
753 |
|
---|
754 |
|
---|
755 | typedef GLint (APIENTRY *crCreateContextProc)(const char *dpyName, GLint visBits);
|
---|
756 | typedef void (APIENTRY *crDestroyContextProc)(GLint context);
|
---|
757 | typedef void (APIENTRY *crMakeCurrentProc)(GLint window, GLint context);
|
---|
758 | typedef GLint (APIENTRY *crGetCurrentContextProc)(void);
|
---|
759 | typedef GLint (APIENTRY *crGetCurrentWindowProc)(void);
|
---|
760 | typedef void (APIENTRY *crSwapBuffersProc)(GLint window, GLint flags);
|
---|
761 |
|
---|
762 | typedef GLint (APIENTRY *crWindowCreateProc)(const char *dpyName, GLint visBits);
|
---|
763 | typedef void (APIENTRY *crWindowDestroyProc)(GLint window);
|
---|
764 | typedef void (APIENTRY *crWindowSizeProc)(GLint window, GLint w, GLint h);
|
---|
765 | typedef void (APIENTRY *crWindowPositionProc)(GLint window, GLint x, GLint y);
|
---|
766 | typedef void (APIENTRY *crWindowShowProc)( GLint window, GLint flag );
|
---|
767 |
|
---|
768 | extern GLint APIENTRY crCreateContext(const char *dpyName, GLint visBits);
|
---|
769 | extern void APIENTRY crDestroyContext(GLint context);
|
---|
770 | extern void APIENTRY crMakeCurrent(GLint window, GLint context);
|
---|
771 | extern GLint APIENTRY crGetCurrentContext(void);
|
---|
772 | extern GLint APIENTRY crGetCurrentWindow(void);
|
---|
773 | extern void APIENTRY crSwapBuffers(GLint window, GLint flags);
|
---|
774 | extern GLint APIENTRY crWindowCreate(const char *dpyName, GLint visBits);
|
---|
775 | extern void APIENTRY crWindowDestroy(GLint window);
|
---|
776 | extern void APIENTRY crWindowSize(GLint window, GLint w, GLint h);
|
---|
777 | extern void APIENTRY crWindowPosition(GLint window, GLint x, GLint y);
|
---|
778 | extern void APIENTRY crWindowVisibleRegion( GLint window, GLint cRects, const void *pRects );
|
---|
779 | extern void APIENTRY crWindowShow( GLint window, GLint flag );
|
---|
780 | extern void APIENTRY crVBoxTexPresent(GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, const GLint *pRects);
|
---|
781 |
|
---|
782 | typedef int (CR_APIENTRY *CR_PROC)();
|
---|
783 | CR_PROC APIENTRY crGetProcAddress( const char *name );
|
---|
784 |
|
---|
785 |
|
---|
786 |
|
---|
787 | /**********************************************************************/
|
---|
788 | /***** Other useful stuff *****/
|
---|
789 | /**********************************************************************/
|
---|
790 |
|
---|
791 | #ifdef WINDOWS
|
---|
792 | #define GET_PROC(NAME) wglGetProcAddress((const GLbyte *) (NAME))
|
---|
793 | #elif defined(DARWIN)
|
---|
794 | #define GET_PROC(NAME) NULL
|
---|
795 | #elif defined(GLX_ARB_get_proc_address)
|
---|
796 | #define GET_PROC(NAME) glXGetProcAddressARB((const GLubyte *) (NAME))
|
---|
797 | #else
|
---|
798 | /* For SGI, etc that don't have glXGetProcAddress(). */
|
---|
799 | #define GET_PROC(NAME) NULL
|
---|
800 | #endif
|
---|
801 |
|
---|
802 | #ifdef __cplusplus
|
---|
803 | }
|
---|
804 | #endif
|
---|
805 |
|
---|
806 | #endif /* __CHROMIUM_H__ */
|
---|