Debugger() takes a string parameter.
[nvidia.git] / doc / glx.h
CommitLineData
8b1b599b
SS
1#ifndef __glx_h__
2#define __glx_h__
3
4/*
5** The contents of this file are subject to the GLX Public License Version 1.0
6** (the "License"). You may not use this file except in compliance with the
7** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
8** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
9** or at http://www.sgi.com/software/opensource/glx/license.html.
10**
11** Software distributed under the License is distributed on an "AS IS"
12** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
13** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
14** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
15** language governing rights and limitations under the License.
16**
17** The Original Software is GLX version 1.2 source code, released February,
18** 1999. The developer of the Original Software is Silicon Graphics, Inc.
19** Those portions of the Subject Software created by Silicon Graphics, Inc.
20** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
21*/
22
23#include <X11/Xlib.h>
24#include <X11/Xutil.h>
25#include <X11/Xmd.h>
26#include <GL/gl.h>
27#include <GL/glxtokens.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*
34 * GLX resources.
35 */
36typedef XID GLXContextID;
37typedef XID GLXPixmap;
38typedef XID GLXDrawable;
39typedef XID GLXPbuffer;
40typedef XID GLXWindow;
41typedef XID GLXFBConfigID;
42
43/*
44 * GLXContext is a pointer to opaque data.
45 */
46typedef struct __GLXcontextRec *GLXContext;
47
48/*
49 * GLXFBConfig is a pointer to opaque data.
50 */
51typedef struct __GLXFBConfigRec *GLXFBConfig;
52typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
53
54
55/*
56 * GLXVideoDeviceNV is an opaque handle to a video device (part of the
57 * GLX_NV_video_out extension).
58 */
59typedef unsigned int GLXVideoDeviceNV;
60
61
62/**********************************************************************/
63
64/*
65 * GLX 1.0 functions.
66 */
67extern XVisualInfo* glXChooseVisual(Display *dpy, int screen,
68 int *attrib_list);
69
70extern void glXCopyContext(Display *dpy, GLXContext src,
71 GLXContext dst, unsigned long mask);
72
73extern GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
74 GLXContext share_list, Bool direct);
75
76extern GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
77 Pixmap pixmap);
78
79extern void glXDestroyContext(Display *dpy, GLXContext ctx);
80
81extern void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix);
82
83extern int glXGetConfig(Display *dpy, XVisualInfo *vis,
84 int attrib, int *value);
85
86extern GLXContext glXGetCurrentContext(void);
87
88extern GLXDrawable glXGetCurrentDrawable(void);
89
90extern Bool glXIsDirect(Display *dpy, GLXContext ctx);
91
92extern Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable,
93 GLXContext ctx);
94
95extern Bool glXQueryExtension(Display *dpy, int *error_base, int *event_base);
96
97extern Bool glXQueryVersion(Display *dpy, int *major, int *minor);
98
99extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable);
100
101extern void glXUseXFont(Font font, int first, int count, int list_base);
102
103extern void glXWaitGL(void);
104
105extern void glXWaitX(void);
106
107
108/*
109 * GLX 1.1 functions.
110 */
111extern const char *glXGetClientString(Display *dpy, int name);
112
113extern const char *glXQueryServerString(Display *dpy, int screen, int name);
114
115extern const char *glXQueryExtensionsString(Display *dpy, int screen);
116
117
118/*
119 * GLX 1.2 functions.
120 */
121extern Display *glXGetCurrentDisplay(void);
122
123
124/*
125 * GLX 1.3 functions.
126 */
127extern GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
128 const int *attrib_list, int *nelements);
129
130extern GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
131 int render_type, GLXContext share_list,
132 Bool direct);
133
134extern GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config,
135 const int *attrib_list);
136
137extern GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config,
138 Pixmap pixmap, const int *attrib_list);
139
140extern GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config,
141 Window win, const int *attrib_list);
142
143extern void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
144
145extern void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
146
147extern void glXDestroyWindow(Display *dpy, GLXWindow win);
148
149extern GLXDrawable glXGetCurrentReadDrawable(void);
150
151extern int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
152 int attribute, int *value);
153
154extern GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements);
155
156extern void glXGetSelectedEvent(Display *dpy, GLXDrawable draw,
157 unsigned long *event_mask);
158
159extern XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
160
161extern Bool glXMakeContextCurrent(Display *display, GLXDrawable draw,
162 GLXDrawable read, GLXContext ctx);
163
164extern int glXQueryContext(Display *dpy, GLXContext ctx,
165 int attribute, int *value);
166
167extern void glXQueryDrawable(Display *dpy, GLXDrawable draw,
168 int attribute, unsigned int *value);
169
170extern void glXSelectEvent(Display *dpy, GLXDrawable draw,
171 unsigned long event_mask);
172
173/*
174 * GLX 1.4 functions.
175 */
176extern void (*glXGetProcAddress(const GLubyte *procName))(void);
177
178
179/**********************************************************************/
180
181/*
182 * ARB_get_proc_address
183 */
184extern void (*glXGetProcAddressARB(const GLubyte *procName))(void);
185
186/*
187 * EXT_import_context
188 */
189extern Display *glXGetCurrentDisplayEXT(void);
190
191extern void glXFreeContextEXT(Display *dpy, GLXContext ctx);
192
193extern GLXContextID glXGetContextIDEXT(const GLXContext ctx);
194
195extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
196
197extern int glXQueryContextInfoEXT(Display *dpy, GLXContext ctx,
198 int attribute, int *value);
199
200/*
201 * NV_vertex_array_range
202 */
203extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
204 GLfloat writefreq, GLfloat priority);
205
206extern void glXFreeMemoryNV(GLvoid *pointer);
207
208/*
209 * SGI_video_sync
210 */
211extern int glXGetVideoSyncSGI(unsigned int *count);
212
213extern int glXWaitVideoSyncSGI(int divisor, int remainder,
214 unsigned int *count);
215
216extern int glXGetRefreshRateSGI(unsigned int *rate);
217
218/*
219 * SGI_swap_control
220 */
221
222extern int glXSwapIntervalSGI(int interval);
223
224/*
225 * NV_swap_group
226 */
227
228extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
229 GLuint group);
230
231extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
232
233extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
234 GLuint *group, GLuint *barrier);
235
236extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
237 GLuint *maxGroups, GLuint *maxBarriers);
238
239extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
240
241extern Bool glXResetFrameCountNV(Display *dpy, int screen);
242
243
244/*
245 * NV_video_out
246 */
247
248extern int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices,
249 GLXVideoDeviceNV *pVideoDevice);
250
251extern int glXReleaseVideoDeviceNV(Display *dpy, int screen,
252 GLXVideoDeviceNV VideoDevice);
253
254extern int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice,
255 GLXPbuffer pbuf, int iVideoBuffer);
256
257extern int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf);
258
259extern int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf,
260 int iBufferType,
261 unsigned long *pulCounterPbuffer,
262 GLboolean bBlock);
263
264extern int glXGetVideoInfoNV(Display *dpy, int screen,
265 GLXVideoDeviceNV VideoDevice,
266 unsigned long *pulCounterOutputVideo,
267 unsigned long *pulCounterOutputPbuffer);
268
269
270/*
271 * SGIX_fbconfig
272 */
273
274extern int glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
275 int attribute, int *value_return);
276
277extern GLXFBConfigSGIX *glXChooseFBConfigSGIX(Display *dpy, int screen,
278 const int *attrib_list,
279 int *nelements);
280
281extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
282 GLXFBConfigSGIX config,
283 Pixmap pixmap);
284
285extern GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
286 GLXFBConfigSGIX config,
287 int render_type,
288 GLXContext share_list,
289 Bool direct);
290
291extern XVisualInfo *glXGetVisualFromFBConfigSGIX(Display *dpy,
292 GLXFBConfigSGIX config);
293
294extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
295 XVisualInfo *vis);
296
297/*
298 * SGIX_pbuffer
299 */
300extern GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config,
301 unsigned int width,
302 unsigned int height,
303 const int *attrib_list);
304
305extern void glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf);
306
307extern void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf,
308 int attribute, unsigned int *value);
309
310extern void glXSelectEventSGIX(Display *dpy, GLXDrawable drawable,
311 unsigned long mask);
312
313extern void glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable,
314 unsigned long *mask);
315
316/*
317 * EXT_texture_from_pixmap
318 */
319extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer,
320 const int *attrib_list);
321extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
322
323/*
324 * SGIX_video_resize
325 */
326extern int glXBindChannelToWindowSGIX(Display *display,
327 int screen, int channel, Window window);
328
329extern int glXChannelRectSGIX(Display *display, int screen, int channel,
330 int x, int y, int w, int h);
331
332extern int glXQueryChannelRectSGIX(Display *display, int screen, int channel,
333 int *dx, int *dy, int *dw, int *dh);
334
335extern int glXQueryChannelDeltasSGIX(Display *display, int screen, int channel,
336 int *x, int *y, int *w, int *h);
337
338extern int glXChannelRectSyncSGIX(Display *display, int screen, int channel,
339 GLenum synctype);
340
341/**********************************************************************/
342
343/*** Should these go here, or in another header? */
344/*
345 * GLX Events
346 */
347typedef struct {
348 int event_type; /* GLX_DAMAGED or GLX_SAVED */
349 int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
350 unsigned long serial; /* # of last request processed by server */
351 Bool send_event; /* true if this came for SendEvent request */
352 Display *display; /* display the event was read from */
353 GLXDrawable drawable; /* XID of Drawable */
354 unsigned int buffer_mask; /* mask indicating which buffers are affected */
355 unsigned int aux_buffer; /* which aux buffer was affected */
356 int x, y;
357 int width, height;
358 int count; /* if nonzero, at least this many more */
359} GLXPbufferClobberEvent;
360
361typedef union __GLXEvent {
362 GLXPbufferClobberEvent glxpbufferclobber;
363 long pad[24];
364} GLXEvent;
365
366#ifdef __cplusplus
367}
368#endif
369
370#endif /* !__glx_h__ */