Quash annoying compiler warning
[mesa.git] / include / GL / glx.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 4.1
4 *
5 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
26 #ifndef GLX_H
27 #define GLX_H
28
29
30 #ifdef __VMS
31 #include <GL/vms_x_fix.h>
32 # ifdef __cplusplus
33 /* VMS Xlib.h gives problems with C++.
34 * this avoids a bunch of trivial warnings */
35 #pragma message disable nosimpint
36 #endif
37 #endif
38 #include <X11/Xlib.h>
39 #include <X11/Xutil.h>
40 #ifdef __VMS
41 # ifdef __cplusplus
42 #pragma message enable nosimpint
43 #endif
44 #endif
45 #include <GL/gl.h>
46
47
48 #if defined(USE_MGL_NAMESPACE)
49 #include <GL/glx_mangle.h>
50 #endif
51
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57
58 #define GLX_VERSION_1_1 1
59 #define GLX_VERSION_1_2 1
60 #define GLX_VERSION_1_3 1
61 #define GLX_VERSION_1_4 1
62
63 #define GLX_EXTENSION_NAME "GLX"
64
65
66
67 /*
68 * Tokens for glXChooseVisual and glXGetConfig:
69 */
70 #define GLX_USE_GL 1
71 #define GLX_BUFFER_SIZE 2
72 #define GLX_LEVEL 3
73 #define GLX_RGBA 4
74 #define GLX_DOUBLEBUFFER 5
75 #define GLX_STEREO 6
76 #define GLX_AUX_BUFFERS 7
77 #define GLX_RED_SIZE 8
78 #define GLX_GREEN_SIZE 9
79 #define GLX_BLUE_SIZE 10
80 #define GLX_ALPHA_SIZE 11
81 #define GLX_DEPTH_SIZE 12
82 #define GLX_STENCIL_SIZE 13
83 #define GLX_ACCUM_RED_SIZE 14
84 #define GLX_ACCUM_GREEN_SIZE 15
85 #define GLX_ACCUM_BLUE_SIZE 16
86 #define GLX_ACCUM_ALPHA_SIZE 17
87
88
89 /*
90 * Error codes returned by glXGetConfig:
91 */
92 #define GLX_BAD_SCREEN 1
93 #define GLX_BAD_ATTRIBUTE 2
94 #define GLX_NO_EXTENSION 3
95 #define GLX_BAD_VISUAL 4
96 #define GLX_BAD_CONTEXT 5
97 #define GLX_BAD_VALUE 6
98 #define GLX_BAD_ENUM 7
99
100
101 /*
102 * GLX 1.1 and later:
103 */
104 #define GLX_VENDOR 1
105 #define GLX_VERSION 2
106 #define GLX_EXTENSIONS 3
107
108
109 /*
110 * GLX 1.3 and later:
111 */
112 #define GLX_CONFIG_CAVEAT 0x20
113 #define GLX_DONT_CARE 0xFFFFFFFF
114 #define GLX_SLOW_CONFIG 0x8001
115 #define GLX_NON_CONFORMANT_CONFIG 0x800D
116 #define GLX_X_VISUAL_TYPE 0x22
117 #define GLX_TRANSPARENT_TYPE 0x23
118 #define GLX_TRANSPARENT_INDEX_VALUE 0x24
119 #define GLX_TRANSPARENT_RED_VALUE 0x25
120 #define GLX_TRANSPARENT_GREEN_VALUE 0x26
121 #define GLX_TRANSPARENT_BLUE_VALUE 0x27
122 #define GLX_TRANSPARENT_ALPHA_VALUE 0x28
123 #define GLX_MAX_PBUFFER_WIDTH 0x8016
124 #define GLX_MAX_PBUFFER_HEIGHT 0x8017
125 #define GLX_MAX_PBUFFER_PIXELS 0x8018
126 #define GLX_PRESERVED_CONTENTS 0x801B
127 #define GLX_LARGEST_PBUFFER 0x801C
128 #define GLX_WIDTH 0x801D
129 #define GLX_HEIGHT 0x801E
130 #define GLX_EVENT_MASK 0x801F
131 #define GLX_DRAWABLE_TYPE 0x8010
132 #define GLX_FBCONFIG_ID 0x8013
133 #define GLX_VISUAL_ID 0x800B
134 #define GLX_WINDOW_BIT 0x00000001
135 #define GLX_PIXMAP_BIT 0x00000002
136 #define GLX_PBUFFER_BIT 0x00000004
137 #define GLX_AUX_BUFFERS_BIT 0x00000010
138 #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
139 #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
140 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
141 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
142 #define GLX_DEPTH_BUFFER_BIT 0x00000020
143 #define GLX_STENCIL_BUFFER_BIT 0x00000040
144 #define GLX_ACCUM_BUFFER_BIT 0x00000080
145 #define GLX_DRAWABLE_TYPE 0x8010
146 #define GLX_RENDER_TYPE 0x8011
147 #define GLX_X_RENDERABLE 0x8012
148 #define GLX_NONE 0x8000
149 #define GLX_TRUE_COLOR 0x8002
150 #define GLX_DIRECT_COLOR 0x8003
151 #define GLX_PSEUDO_COLOR 0x8004
152 #define GLX_STATIC_COLOR 0x8005
153 #define GLX_GRAY_SCALE 0x8006
154 #define GLX_STATIC_GRAY 0x8007
155 #define GLX_TRANSPARENT_RGB 0x8008
156 #define GLX_TRANSPARENT_INDEX 0x8009
157 #define GLX_RGBA_TYPE 0x8014
158 #define GLX_COLOR_INDEX_TYPE 0x8015
159 #define GLX_COLOR_INDEX_BIT 0x00000002
160 #define GLX_RGBA_BIT 0x00000001
161 #define GLX_SCREEN 0x800C
162 #define GLX_PBUFFER_CLOBBER_MASK 0x08000000
163 #define GLX_DAMAGED 0x8020
164 #define GLX_SAVED 0x8021
165 #define GLX_WINDOW 0x8022
166 #define GLX_PBUFFER 0x8023
167 #define GLX_PBUFFER_HEIGHT 0x8040
168 #define GLX_PBUFFER_WIDTH 0x8041
169
170
171 /*
172 * GLX 1.4 and later:
173 */
174 #define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
175 #define GLX_SAMPLES 0x186a1 /*100001*/
176
177
178
179 typedef struct __GLXcontextRec *GLXContext;
180 typedef XID GLXPixmap;
181 typedef XID GLXDrawable;
182 /* GLX 1.3 and later */
183 typedef struct __GLXFBConfigRec *GLXFBConfig;
184 typedef XID GLXFBConfigID;
185 typedef XID GLXContextID;
186 typedef XID GLXWindow;
187 typedef XID GLXPbuffer;
188
189
190
191 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
192 int *attribList );
193
194 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
195 GLXContext shareList, Bool direct );
196
197 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
198
199 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
200 GLXContext ctx);
201
202 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
203 unsigned long mask );
204
205 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
206
207 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
208 Pixmap pixmap );
209
210 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
211
212 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
213
214 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
215
216 extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
217
218 extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
219 int attrib, int *value );
220
221 extern GLXContext glXGetCurrentContext( void );
222
223 extern GLXDrawable glXGetCurrentDrawable( void );
224
225 extern void glXWaitGL( void );
226
227 extern void glXWaitX( void );
228
229 extern void glXUseXFont( Font font, int first, int count, int list );
230
231
232
233 /* GLX 1.1 and later */
234 extern const char *glXQueryExtensionsString( Display *dpy, int screen );
235
236 extern const char *glXQueryServerString( Display *dpy, int screen, int name );
237
238 extern const char *glXGetClientString( Display *dpy, int name );
239
240
241 /* GLX 1.2 and later */
242 extern Display *glXGetCurrentDisplay( void );
243
244
245 /* GLX 1.3 and later */
246 extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
247 const int *attribList, int *nitems );
248
249 extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
250 int attribute, int *value );
251
252 extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
253 int *nelements );
254
255 extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
256 GLXFBConfig config );
257
258 extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
259 Window win, const int *attribList );
260
261 extern void glXDestroyWindow( Display *dpy, GLXWindow window );
262
263 extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
264 Pixmap pixmap, const int *attribList );
265
266 extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
267
268 extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
269 const int *attribList );
270
271 extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
272
273 extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
274 unsigned int *value );
275
276 extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
277 int renderType, GLXContext shareList,
278 Bool direct );
279
280 extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
281 GLXDrawable read, GLXContext ctx );
282
283 extern GLXDrawable glXGetCurrentReadDrawable( void );
284
285 extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
286 int *value );
287
288 extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
289 unsigned long mask );
290
291 extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
292 unsigned long *mask );
293
294
295 /* GLX 1.4 and later */
296 extern void (*glXGetProcAddress(const GLubyte *procname))( void );
297
298
299 #ifndef GLX_GLXEXT_LEGACY
300
301 #include <GL/glxext.h>
302
303 #else
304
305
306 /*
307 * 28. GLX_EXT_visual_info extension
308 */
309 #ifndef GLX_EXT_visual_info
310 #define GLX_EXT_visual_info 1
311
312 #define GLX_X_VISUAL_TYPE_EXT 0x22
313 #define GLX_TRANSPARENT_TYPE_EXT 0x23
314 #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
315 #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
316 #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
317 #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
318 #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
319 #define GLX_TRUE_COLOR_EXT 0x8002
320 #define GLX_DIRECT_COLOR_EXT 0x8003
321 #define GLX_PSEUDO_COLOR_EXT 0x8004
322 #define GLX_STATIC_COLOR_EXT 0x8005
323 #define GLX_GRAY_SCALE_EXT 0x8006
324 #define GLX_STATIC_GRAY_EXT 0x8007
325 #define GLX_NONE_EXT 0x8000
326 #define GLX_TRANSPARENT_RGB_EXT 0x8008
327 #define GLX_TRANSPARENT_INDEX_EXT 0x8009
328
329 #endif /* 28. GLX_EXT_visual_info extension */
330
331
332
333 /*
334 * 41. GLX_SGI_video_sync
335 */
336 #ifndef GLX_SGI_video_sync
337 #define GLX_SGI_video_sync 1
338
339 extern int glXGetVideoSyncSGI(unsigned int *count);
340 extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
341
342 #endif /* GLX_SGI_video_sync */
343
344
345
346 /*
347 * 42. GLX_EXT_visual_rating
348 */
349 #ifndef GLX_EXT_visual_rating
350 #define GLX_EXT_visual_rating 1
351
352 #define GLX_VISUAL_CAVEAT_EXT 0x20
353 /*#define GLX_NONE_EXT 0x8000*/
354 #define GLX_SLOW_VISUAL_EXT 0x8001
355 #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
356
357 #endif /* GLX_EXT_visual_rating */
358
359
360
361 /*
362 * 47. GLX_EXT_import_context
363 */
364 #ifndef GLX_EXT_import_context
365 #define GLX_EXT_import_context 1
366
367 #define GLX_SHARE_CONTEXT_EXT 0x800A
368 #define GLX_VISUAL_ID_EXT 0x800B
369 #define GLX_SCREEN_EXT 0x800C
370
371 extern void glXFreeContextEXT(Display *dpy, GLXContext context);
372
373 extern GLXContextID glXGetContextIDEXT(const GLXContext context);
374
375 extern Display *glXGetCurrentDisplayEXT(void);
376
377 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
378
379 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
380 int attribute,int *value);
381
382 #endif /* GLX_EXT_import_context */
383
384
385
386 /*
387 * 215. GLX_MESA_copy_sub_buffer
388 */
389 #ifndef GLX_MESA_copy_sub_buffer
390 #define GLX_MESA_copy_sub_buffer 1
391
392 extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
393 int x, int y, int width, int height );
394
395 #endif
396
397
398
399 /*
400 * 216. GLX_MESA_pixmap_colormap
401 */
402 #ifndef GLX_MESA_pixmap_colormap
403 #define GLX_MESA_pixmap_colormap 1
404
405 extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
406 Pixmap pixmap, Colormap cmap );
407
408 #endif /* GLX_MESA_pixmap_colormap */
409
410
411
412 /*
413 * 217. GLX_MESA_release_buffers
414 */
415 #ifndef GLX_MESA_release_buffers
416 #define GLX_MESA_release_buffers 1
417
418 extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
419
420 #endif /* GLX_MESA_release_buffers */
421
422
423
424 /*
425 * 218. GLX_MESA_set_3dfx_mode
426 */
427 #ifndef GLX_MESA_set_3dfx_mode
428 #define GLX_MESA_set_3dfx_mode 1
429
430 #define GLX_3DFX_WINDOW_MODE_MESA 0x1
431 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
432
433 extern Bool glXSet3DfxModeMESA( int mode );
434
435 #endif /* GLX_MESA_set_3dfx_mode */
436
437
438
439 /*
440 * ARB 2. GLX_ARB_get_proc_address
441 */
442 #ifndef GLX_ARB_get_proc_address
443 #define GLX_ARB_get_proc_address 1
444
445 extern void (*glXGetProcAddressARB(const GLubyte *procName))();
446
447 #endif /* GLX_ARB_get_proc_address */
448
449
450
451 #endif /* GLX_GLXEXT_LEGACY */
452
453
454 /**
455 ** The following aren't in glxext.h yet.
456 **/
457
458
459 /*
460 * ???. GLX_NV_vertex_array_range
461 */
462 #ifndef GLX_NV_vertex_array_range
463 #define GLX_NV_vertex_array_range
464
465 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
466 extern void glXFreeMemoryNV(GLvoid *pointer);
467 typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
468 typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
469
470 #endif /* GLX_NV_vertex_array_range */
471
472
473
474 /*
475 * ???. GLX_MESA_agp_offset
476 */
477 #ifndef GLX_MESA_agp_offset
478 #define GLX_MESA_agp_offset 1
479
480 extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer);
481 typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer);
482
483 #endif /* GLX_MESA_agp_offset */
484
485
486 /*
487 * ARB ?. GLX_ARB_render_texture
488 */
489 #ifndef GLX_ARB_render_texture
490 #define GLX_ARB_render_texture 1
491
492 extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
493 extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
494 extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
495
496 #endif /* GLX_ARB_render_texture */
497
498
499
500 #ifdef __cplusplus
501 }
502 #endif
503
504 #endif