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