Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

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