version 2.8
glx.h
1 #ifndef GLX_H
2 #define GLX_H
3 
4 #include <X11/Xlib.h>
5 #include <X11/Xutil.h>
6 #include <GL/gl.h>
7 
8 
9 /* the following comes from Mesa */
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 
16 #define GLX_VERSION_1_1 1
17 
18 
19 /*
20  * Tokens for glXChooseVisual and glXGetConfig:
21  */
22 enum _GLX_CONFIGS {
23  GLX_USE_GL = 1,
24  GLX_BUFFER_SIZE = 2,
25  GLX_LEVEL = 3,
26  GLX_RGBA = 4,
27  GLX_DOUBLEBUFFER = 5,
28  GLX_STEREO = 6,
29  GLX_AUX_BUFFERS = 7,
30  GLX_RED_SIZE = 8,
31  GLX_GREEN_SIZE = 9,
32  GLX_BLUE_SIZE = 10,
33  GLX_ALPHA_SIZE = 11,
34  GLX_DEPTH_SIZE = 12,
35  GLX_STENCIL_SIZE = 13,
36  GLX_ACCUM_RED_SIZE = 14,
37  GLX_ACCUM_GREEN_SIZE = 15,
38  GLX_ACCUM_BLUE_SIZE = 16,
39  GLX_ACCUM_ALPHA_SIZE = 17,
40 
41  /* GLX_EXT_visual_info extension */
42  GLX_X_VISUAL_TYPE_EXT = 0x22,
43  GLX_TRANSPARENT_TYPE_EXT = 0x23,
44  GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24,
45  GLX_TRANSPARENT_RED_VALUE_EXT = 0x25,
46  GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26,
47  GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27,
48  GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28
49 };
50 
51 
52 /*
53  * Error codes returned by glXGetConfig:
54  */
55 #define GLX_BAD_SCREEN 1
56 #define GLX_BAD_ATTRIBUTE 2
57 #define GLX_NO_EXTENSION 3
58 #define GLX_BAD_VISUAL 4
59 #define GLX_BAD_CONTEXT 5
60 #define GLX_BAD_VALUE 6
61 #define GLX_BAD_ENUM 7
62 
63 
64 /*
65  * GLX 1.1 and later:
66  */
67 #define GLX_VENDOR 1
68 #define GLX_VERSION 2
69 #define GLX_EXTENSIONS 3
70 
71 
72 /*
73  * GLX_visual_info extension
74  */
75 #define GLX_TRUE_COLOR_EXT 0x8002
76 #define GLX_DIRECT_COLOR_EXT 0x8003
77 #define GLX_PSEUDO_COLOR_EXT 0x8004
78 #define GLX_STATIC_COLOR_EXT 0x8005
79 #define GLX_GRAY_SCALE_EXT 0x8006
80 #define GLX_STATIC_GRAY_EXT 0x8007
81 #define GLX_NONE_EXT 0x8000
82 #define GLX_TRANSPARENT_RGB_EXT 0x8008
83 #define GLX_TRANSPARENT_INDEX_EXT 0x8009
84 
85 
86 typedef void *GLXContext;
87 typedef Pixmap GLXPixmap;
88 typedef Drawable GLXDrawable;
89 typedef XID GLXContextID;
90 
91 
92 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
93  int *attribList );
94 
95 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
96  GLXContext shareList, Bool direct );
97 
98 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
99 
100 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
101  GLXContext ctx);
102 
103 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
104  GLuint mask );
105 
106 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
107 
108 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
109  Pixmap pixmap );
110 
111 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
112 
113 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
114 
115 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
116 
117 extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
118 
119 extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
120  int attrib, int *value );
121 
122 extern GLXContext glXGetCurrentContext( void );
123 
124 extern GLXDrawable glXGetCurrentDrawable( void );
125 
126 extern void glXWaitGL( void );
127 
128 extern void glXWaitX( void );
129 
130 extern void glXUseXFont( Font font, int first, int count, int list );
131 
132 
133 /* GLX 1.1 and later */
134 extern const char *glXQueryExtensionsString( Display *dpy, int screen );
135 
136 extern const char *glXQueryServerString( Display *dpy, int screen, int name );
137 
138 extern const char *glXGetClientString( Display *dpy, int name );
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif