Fix several conformance problems. Hack solution to line stipple problem.
[mesa.git] / src / mesa / drivers / x11 / glxapi.h
1 /* $Id: glxapi.h,v 1.8 2000/12/15 04:02:50 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
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 _glxapi_h_
29 #define _glxapi_h_
30
31
32 #define GLX_GLXEXT_PROTOTYPES
33 #include "GL/glx.h"
34
35
36 /*
37 * Almost all the GLX API functions get routed through this dispatch table.
38 * The exceptions are the glXGetCurrentXXX() functions.
39 *
40 * This dispatch table allows multiple GLX client-side modules to coexist.
41 * Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
42 * pseudo-GLX can be present at the same time. The former being used on
43 * GLX-enabled X servers and the later on non-GLX X servers.
44 *
45 * XXX Note that this hasn't actually been fully used yet in either Mesa or
46 * the DRI. Red Hat, however, has used it for their custom libGL.
47 */
48 struct _glxapi_table {
49 /* GLX 1.0 functions */
50 XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
51 void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
52 GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
53 GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
54 void (*DestroyContext)(Display *dpy, GLXContext ctx);
55 void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
56 int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
57 /*GLXContext (*GetCurrentContext)(void);*/
58 /*GLXDrawable (*GetCurrentDrawable)(void);*/
59 Bool (*IsDirect)(Display *dpy, GLXContext ctx);
60 Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
61 Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
62 Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
63 void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
64 void (*UseXFont)(Font font, int first, int count, int listBase);
65 void (*WaitGL)(void);
66 void (*WaitX)(void);
67
68 #ifdef GLX_VERSION_1_1
69 const char *(*GetClientString)(Display *dpy, int name);
70 const char *(*QueryExtensionsString)(Display *dpy, int screen);
71 const char *(*QueryServerString)(Display *dpy, int screen, int name);
72 #endif
73
74 #ifdef GLX_VERSION_1_2
75 /*Display *(*GetCurrentDisplay)(void);*/
76 #endif
77
78 #ifdef GLX_VERSION_1_3
79 GLXFBConfig *(*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
80 GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
81 GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
82 GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
83 GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
84 void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
85 void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
86 void (*DestroyWindow)(Display *dpy, GLXWindow window);
87 /*GLXDrawable (*GetCurrentReadDrawable)(void);*/
88 int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
89 GLXFBConfig *(*GetFBConfigs)(Display *dpy, int screen, int *nelements);
90 void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
91 XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
92 Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
93 int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
94 void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
95 void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
96 #endif
97
98 #ifdef GLX_SGI_swap_control
99 int (*SwapIntervalSGI)(int);
100 #endif
101
102 #ifdef GLX_SGI_video_sync
103 int (*GetVideoSyncSGI)(unsigned int *count);
104 int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
105 #endif
106
107 #ifdef GLX_SGI_make_current_read
108 Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
109 GLXDrawable (*GetCurrentReadDrawableSGI)(void);
110 #endif
111
112 #if defined(_VL_H) && defined(GLX_SGIX_video_source)
113 GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
114 void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
115 #endif
116
117 #ifdef GLX_EXT_import_context
118 void (*FreeContextEXT)(Display *dpy, GLXContext context);
119 GLXContextID (*GetContextIDEXT)(const GLXContext context);
120 Display *(*GetCurrentDisplayEXT)(void);
121 GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
122 int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
123 #endif
124
125 #ifdef GLX_SGIX_fbconfig
126 int (*GetFBConfigAttribSGIX)(Display *, GLXFBConfigSGIX, int, int *);
127 GLXFBConfigSGIX * (*ChooseFBConfigSGIX)(Display *, int, int *, int *);
128 GLXPixmap (*CreateGLXPixmapWithConfigSGIX)(Display *, GLXFBConfigSGIX, Pixmap);
129 GLXContext (*CreateContextWithConfigSGIX)(Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
130 XVisualInfo * (*GetVisualFromFBConfigSGIX)(Display *, GLXFBConfigSGIX);
131 GLXFBConfigSGIX (*GetFBConfigFromVisualSGIX)(Display *, XVisualInfo *);
132 #endif
133
134 #ifdef GLX_SGIX_pbuffer
135 GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
136 void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
137 int (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
138 void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
139 void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
140 #endif
141
142 #ifdef GLX_SGI_cushion
143 void (*CushionSGI)(Display *, Window, float);
144 #endif
145
146 #ifdef GLX_SGIX_video_resize
147 int (*BindChannelToWindowSGIX)(Display *, int, int, Window);
148 int (*ChannelRectSGIX)(Display *, int, int, int, int, int, int);
149 int (*QueryChannelRectSGIX)(Display *, int, int, int *, int *, int *, int *);
150 int (*QueryChannelDeltasSGIX)(Display *, int, int, int *, int *, int *, int *);
151 int (*ChannelRectSyncSGIX)(Display *, int, int, GLenum);
152 #endif
153
154 #if defined (_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
155 Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
156 #endif
157
158 #ifdef GLX_SGIX_swap_group
159 void (*JoinSwapGroupSGIX)(Display *, GLXDrawable, GLXDrawable);
160 #endif
161
162 #ifdef GLX_SGIX_swap_barrier
163 void (*BindSwapBarrierSGIX)(Display *, GLXDrawable, int);
164 Bool (*QueryMaxSwapBarriersSGIX)(Display *, int, int *);
165 #endif
166
167 #ifdef GLX_SUN_get_transparent_index
168 Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *);
169 #endif
170
171 #ifdef GLX_MESA_copy_sub_buffer
172 void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
173 #endif
174
175 #ifdef GLX_MESA_release_buffers
176 Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
177 #endif
178
179 #ifdef GLX_MESA_pixmap_colormap
180 GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
181 #endif
182
183 #ifdef GLX_MESA_set_3dfx_mode
184 Bool (*Set3DfxModeMESA)(int mode);
185 #endif
186
187 };
188
189
190
191 extern const char *
192 _glxapi_get_version(void);
193
194
195 extern const char **
196 _glxapi_get_extensions(void);
197
198
199 extern GLuint
200 _glxapi_get_dispatch_table_size(void);
201
202
203 extern void
204 _glxapi_set_no_op_table(struct _glxapi_table *t);
205
206
207 extern const GLvoid *
208 _glxapi_get_proc_address(const char *funcName);
209
210
211 #endif