added extension numbers for Mesa extensions
[mesa.git] / include / GL / glx.h
1 /* $Id: glx.h,v 1.22 2000/06/23 17:39:18 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 #ifndef GLX_H
29 #define GLX_H
30
31
32 #ifdef __VMS
33 # ifdef __cplusplus
34 /* VMS Xlib.h gives problems with C++.
35 * this avoids a bunch of trivial warnings */
36 #pragma message disable nosimpint
37 #endif
38 #endif
39 #include <X11/Xlib.h>
40 #include <X11/Xutil.h>
41 #ifdef __VMS
42 # ifdef __cplusplus
43 #pragma message enable nosimpint
44 #endif
45 #endif
46 #include "GL/gl.h"
47
48
49 #if defined(USE_MGL_NAMESPACE)
50 #include "glx_mangle.h"
51 #endif
52
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58
59 #define GLX_VERSION_1_1 1
60 #define GLX_VERSION_1_2 1
61 #define GLX_VERSION_1_3 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_BUFFER 0x801C
128 #define GLX_DRAWABLE_TYPE 0x8010
129 #define GLX_FBCONFIG_ID 0x8013
130 #define GLX_VISUAL_ID 0x800B
131 #define GLX_WINDOW_BIT 0x00000001
132 #define GLX_PIXMAP_BIT 0x00000002
133 #define GLX_PBUFFER_BIT 0x00000004
134 #define GLX_AUX_BUFFERS_BIT 0x00000010
135 #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
136 #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
137 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
138 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
139 #define GLX_AUX_BUFFERS_BIT 0x00000010
140 #define GLX_DEPTH_BUFFER_BIT 0x00000020
141 #define GLX_STENCIL_BUFFER_BIT 0x00000040
142 #define GLX_ACCUM_BUFFER_BIT 0x00000080
143 #define GLX_DRAWABLE_TYPE 0x8010
144 #define GLX_RENDER_TYPE 0x8011
145 #define GLX_X_RENDERABLE 0x8012
146 #define GLX_NONE 0x8000
147 #define GLX_TRUE_COLOR 0x8002
148 #define GLX_DIRECT_COLOR 0x8003
149 #define GLX_PSEUDO_COLOR 0x8004
150 #define GLX_STATIC_COLOR 0x8005
151 #define GLX_GRAY_SCALE 0x8006
152 #define GLX_STATIC_GRAY 0x8007
153 #define GLX_TRANSPARENT_INDEX 0x8009
154 #define GLX_COLOR_INDEX_TYPE 0x8015
155 #define GLX_COLOR_INDEX_BIT 0x00000002
156 #define GLX_SCREEN 0x800C
157 #define GLX_PBUFFER_CLOBBER_MASK 0x08000000
158 #define GLX_DAMAGED 0x8020
159 #define GLX_SAVED 0x8021
160 #define GLX_WINDOW 0x8022
161 #define GLX_PBUFFER 0x8033
162
163
164
165 typedef void * GLXContext;
166 typedef XID GLXPixmap;
167 typedef XID GLXDrawable;
168 /* GLX 1.3 and later */
169 typedef void * GLXFBConfig;
170 typedef XID GLXFBConfigID;
171 typedef XID GLXContextID;
172 typedef XID GLXWindow;
173 typedef XID GLXPbuffer;
174
175
176
177 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
178 int *attribList );
179
180 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
181 GLXContext shareList, Bool direct );
182
183 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
184
185 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
186 GLXContext ctx);
187
188 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
189 unsigned long mask );
190
191 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
192
193 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
194 Pixmap pixmap );
195
196 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
197
198 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
199
200 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
201
202 extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
203
204 extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
205 int attrib, int *value );
206
207 extern GLXContext glXGetCurrentContext( void );
208
209 extern GLXDrawable glXGetCurrentDrawable( void );
210
211 extern void glXWaitGL( void );
212
213 extern void glXWaitX( void );
214
215 extern void glXUseXFont( Font font, int first, int count, int list );
216
217
218
219 /* GLX 1.1 and later */
220 extern const char *glXQueryExtensionsString( Display *dpy, int screen );
221
222 extern const char *glXQueryServerString( Display *dpy, int screen, int name );
223
224 extern const char *glXGetClientString( Display *dpy, int name );
225
226
227 /* GLX 1.2 and later */
228 extern Display *glXGetCurrentDisplay( void );
229
230
231 /* GLX 1.3 and later */
232 extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
233 const int *attribList, int *nitems );
234
235 extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
236 int attribute, int *value );
237
238 extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
239 int *nelements );
240
241 extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
242 GLXFBConfig config );
243
244 extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
245 Window win, const int *attribList );
246
247 extern void glXDestroyWindow( Display *dpy, GLXWindow window );
248
249 extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
250 Pixmap pixmap, const int *attribList );
251
252 extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
253
254 extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
255 const int *attribList );
256
257 extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
258
259 extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
260 unsigned int *value );
261
262 extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
263 int renderType, GLXContext shareList,
264 Bool direct );
265
266 extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
267 GLXDrawable read, GLXContext ctx );
268
269 extern GLXDrawable glXGetCurrentReadDrawable( void );
270
271 extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
272 int *value );
273
274 extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
275 unsigned long mask );
276
277 extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
278 unsigned long *mask );
279
280
281
282 /*#ifndef GLX_GLXEXT_LEGACY*/
283
284 /*#include <GL/glxext.h>*/
285
286 /*#else*/
287
288
289 /*
290 * 28. GLX_EXT_visual_info extension
291 */
292 #ifndef GLX_EXT_visual_info
293 #define GLX_EXT_visual_info 1
294
295 #define GLX_X_VISUAL_TYPE_EXT 0x22
296 #define GLX_TRANSPARENT_TYPE_EXT 0x23
297 #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
298 #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
299 #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
300 #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
301 #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
302 #define GLX_TRUE_COLOR_EXT 0x8002
303 #define GLX_DIRECT_COLOR_EXT 0x8003
304 #define GLX_PSEUDO_COLOR_EXT 0x8004
305 #define GLX_STATIC_COLOR_EXT 0x8005
306 #define GLX_GRAY_SCALE_EXT 0x8006
307 #define GLX_STATIC_GRAY_EXT 0x8007
308 #define GLX_NONE_EXT 0x8000
309 #define GLX_TRANSPARENT_RGB_EXT 0x8008
310 #define GLX_TRANSPARENT_INDEX_EXT 0x8009
311
312 #endif /* 28. GLX_EXT_visual_info extension */
313
314
315
316 /*
317 * 41. GLX_SGI_video_sync
318 */
319 #ifndef GLX_SGI_video_sync
320 #define GLX_SGI_video_sync 1
321
322 extern int glXGetVideoSyncSGI(unsigned int *count);
323 extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
324
325 #endif /* GLX_SGI_video_sync */
326
327
328
329 /*
330 * 42. GLX_EXT_visual_rating
331 */
332 #ifndef GLX_EXT_visual_rating
333 #define GLX_EXT_visual_rating 1
334
335 #define GLX_VISUAL_CAVEAT_EXT 0x20
336 /*#define GLX_NONE_EXT 0x8000*/
337 #define GLX_SLOW_VISUAL_EXT 0x8001
338 #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
339
340 #endif /* GLX_EXT_visual_rating */
341
342
343
344 /*
345 * 47. GLX_EXT_import_context
346 */
347 #ifndef GLX_EXT_import_context
348 #define GLX_EXT_import_context 1
349
350 #define GLX_SHARE_CONTEXT_EXT 0x800A
351 #define GLX_VISUAL_ID_EXT 0x800B
352 #define GLX_SCREEN_EXT 0x800C
353
354 extern void glXFreeContextEXT(Display *dpy, GLXContext context);
355
356 extern GLXContextID glXGetContextIDEXT(const GLXContext context);
357
358 extern Display *glXGetCurrentDisplayEXT(void);
359
360 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
361
362 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
363 int attribute,int *value);
364
365 #endif /* GLX_EXT_import_context */
366
367
368
369 /*
370 * 215. GLX_MESA_copy_sub_buffer
371 */
372 #ifndef GLX_MESA_copy_sub_buffer
373 #define GLX_MESA_copy_sub_buffer 1
374
375 extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
376 int x, int y, int width, int height );
377
378 #endif
379
380
381
382 /*
383 * 216. GLX_MESA_pixmap_colormap
384 */
385 #ifndef GLX_MESA_pixmap_colormap
386 #define GLX_MESA_pixmap_colormap 1
387
388 extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
389 Pixmap pixmap, Colormap cmap );
390
391 #endif /* GLX_MESA_pixmap_colormap */
392
393
394
395 /*
396 * 217. GLX_MESA_release_buffers
397 */
398 #ifndef GLX_MESA_release_buffers
399 #define GLX_MESA_release_buffers 1
400
401 extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
402
403 #endif /* GLX_MESA_release_buffers */
404
405
406
407 /*
408 * 218. GLX_MESA_set_3dfx_mode
409 */
410 #ifndef GLX_MESA_set_3dfx_mode
411 #define GLX_MESA_set_3dfx_mode 1
412
413 #define GLX_3DFX_WINDOW_MODE_MESA 0x1
414 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
415
416 extern GLboolean glXSet3DfxModeMESA( GLint mode );
417
418 #endif /* GLX_MESA_set_3dfx_mode */
419
420
421
422 /*
423 * ARB 2. GLX_ARB_get_proc_address
424 */
425 #ifndef GLX_ARB_get_proc_address
426 #define GLX_ARB_get_proc_address 1
427
428 extern void (*glXGetProcAddressARB(const GLubyte *procName))();
429
430 #endif /* GLX_ARB_get_proc_address */
431
432
433
434 /*#endif*/ /* GLX_GLXEXT_LEGACY */
435
436
437
438 #ifdef __cplusplus
439 }
440 #endif
441
442 #endif