Debian Codegraph @

debian/external_deps/fetk/sg/src/gl/GL/glx.h

raw
1 /* $Id: glx.h,v 1.2 2000/11/01 22:18:00 mholst Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 2.2
6 * Copyright (C) 1995-1997 Brian Paul
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #ifndef GLX_H
24 #define GLX_H
25
26
27 /*
28 * A pseudo-GLX implementation to allow GLX-based OpenGL programs to
29 * work with Mesa.
30 *
31 * Notes:
32 * 1. If the visual passed to glXGetConfig was not one returned by
33 * glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries
34 * will always return True and the GLX_DEPTH_SIZE query will always
35 * return non-zero.
36 * 2. The glXIsDirect() function always returns True.
37 */
38
39
40
41 #include <X11/Xlib.h>
42 #include <X11/Xutil.h>
43 #include "GL/gl.h"
44 #ifdef MESA
45 #include "GL/xmesa.h"
46 #endif
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
61
62 /*
63 * Tokens for glXChooseVisual and glXGetConfig:
64 */
65 enum _GLX_CONFIGS {
66 GLX_USE_GL = 1,
67 GLX_BUFFER_SIZE = 2,
68 GLX_LEVEL = 3,
69 GLX_RGBA = 4,
70 GLX_DOUBLEBUFFER = 5,
71 GLX_STEREO = 6,
72 GLX_AUX_BUFFERS = 7,
73 GLX_RED_SIZE = 8,
74 GLX_GREEN_SIZE = 9,
75 GLX_BLUE_SIZE = 10,
76 GLX_ALPHA_SIZE = 11,
77 GLX_DEPTH_SIZE = 12,
78 GLX_STENCIL_SIZE = 13,
79 GLX_ACCUM_RED_SIZE = 14,
80 GLX_ACCUM_GREEN_SIZE = 15,
81 GLX_ACCUM_BLUE_SIZE = 16,
82 GLX_ACCUM_ALPHA_SIZE = 17,
83
84 /* GLX_EXT_visual_info extension */
85 GLX_X_VISUAL_TYPE_EXT = 0x22,
86 GLX_TRANSPARENT_TYPE_EXT = 0x23,
87 GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24,
88 GLX_TRANSPARENT_RED_VALUE_EXT = 0x25,
89 GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26,
90 GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27,
91 GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28
92 };
93
94
95 /*
96 * Error codes returned by glXGetConfig:
97 */
98 #define GLX_BAD_SCREEN 1
99 #define GLX_BAD_ATTRIBUTE 2
100 #define GLX_NO_EXTENSION 3
101 #define GLX_BAD_VISUAL 4
102 #define GLX_BAD_CONTEXT 5
103 #define GLX_BAD_VALUE 6
104 #define GLX_BAD_ENUM 7
105
106
107 /*
108 * GLX 1.1 and later:
109 */
110 #define GLX_VENDOR 1
111 #define GLX_VERSION 2
112 #define GLX_EXTENSIONS 3
113
114
115 /*
116 * GLX_visual_info extension
117 */
118 #define GLX_TRUE_COLOR_EXT 0x8002
119 #define GLX_DIRECT_COLOR_EXT 0x8003
120 #define GLX_PSEUDO_COLOR_EXT 0x8004
121 #define GLX_STATIC_COLOR_EXT 0x8005
122 #define GLX_GRAY_SCALE_EXT 0x8006
123 #define GLX_STATIC_GRAY_EXT 0x8007
124 #define GLX_NONE_EXT 0x8000
125 #define GLX_TRANSPARENT_RGB_EXT 0x8008
126 #define GLX_TRANSPARENT_INDEX_EXT 0x8009
127
128
129 /*
130 * Compile-time extension tests
131 */
132 #ifdef MESA
133 #define GLX_EXT_visual_info 1
134 #define GLX_MESA_pixmap_colormap 1
135 #define GLX_MESA_release_buffers 1
136 #endif
137
138
139
140 #ifdef MESA
141 typedef XMesaContext GLXContext;
142 typedef Pixmap GLXPixmap;
143 typedef Drawable GLXDrawable;
144 #else
145 typedef void * GLXContext;
146 typedef XID GLXPixmap;
147 typedef XID GLXDrawable;
148 #endif
149 typedef XID GLXContextID;
150
151
152
153 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
154 int *attribList );
155
156 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
157 GLXContext shareList, Bool direct );
158
159 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
160
161 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
162 GLXContext ctx);
163
164 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
165 GLuint mask );
166
167 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
168
169 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
170 Pixmap pixmap );
171
172 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
173
174 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
175
176 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
177
178 extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
179
180 extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
181 int attrib, int *value );
182
183 extern GLXContext glXGetCurrentContext( void );
184
185 extern GLXDrawable glXGetCurrentDrawable( void );
186
187 extern void glXWaitGL( void );
188
189 extern void glXWaitX( void );
190
191 extern void glXUseXFont( Font font, int first, int count, int list );
192
193
194
195 /* GLX 1.1 and later */
196 extern const char *glXQueryExtensionsString( Display *dpy, int screen );
197
198 extern const char *glXQueryServerString( Display *dpy, int screen, int name );
199
200 extern const char *glXGetClientString( Display *dpy, int name );
201
202
203
204 /*
205 * Mesa GLX Extensions
206 */
207
208 #ifdef GLX_MESA_pixmap_colormap
209 extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
210 Pixmap pixmap, Colormap cmap );
211 #endif
212
213 #ifdef GLX_MESA_release_buffers
214 extern Bool glXReleaseBuffersMESA( Display *dpy, Window w );
215 #endif
216
217
218
219 #ifdef __cplusplus
220 }
221 #endif
222
223 #endif