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.
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.
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.
24 #include <X11/Xutil.h>
27 #include "glxtokens.h"
36 typedef XID GLXContextID;
37 typedef XID GLXPixmap;
38 typedef XID GLXDrawable;
39 typedef XID GLXPbuffer;
40 typedef XID GLXWindow;
41 typedef XID GLXFBConfigID;
44 * GLXContext is a pointer to opaque data.
46 typedef struct __GLXcontextRec *GLXContext;
49 * GLXFBConfig is a pointer to opaque data.
51 typedef struct __GLXFBConfigRec *GLXFBConfig;
52 typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
56 * GLXVideoDeviceNV is an opaque handle to a video device (part of the
57 * GLX_NV_video_out extension).
59 typedef unsigned int GLXVideoDeviceNV;
62 /**********************************************************************/
67 extern XVisualInfo* glXChooseVisual(Display *dpy, int screen,
70 extern void glXCopyContext(Display *dpy, GLXContext src,
71 GLXContext dst, unsigned long mask);
73 extern GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
74 GLXContext share_list, Bool direct);
76 extern GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
79 extern void glXDestroyContext(Display *dpy, GLXContext ctx);
81 extern void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix);
83 extern int glXGetConfig(Display *dpy, XVisualInfo *vis,
84 int attrib, int *value);
86 extern GLXContext glXGetCurrentContext(void);
88 extern GLXDrawable glXGetCurrentDrawable(void);
90 extern Bool glXIsDirect(Display *dpy, GLXContext ctx);
92 extern Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable,
95 extern Bool glXQueryExtension(Display *dpy, int *error_base, int *event_base);
97 extern Bool glXQueryVersion(Display *dpy, int *major, int *minor);
99 extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable);
101 extern void glXUseXFont(Font font, int first, int count, int list_base);
103 extern void glXWaitGL(void);
105 extern void glXWaitX(void);
111 extern const char *glXGetClientString(Display *dpy, int name);
113 extern const char *glXQueryServerString(Display *dpy, int screen, int name);
115 extern const char *glXQueryExtensionsString(Display *dpy, int screen);
121 extern Display *glXGetCurrentDisplay(void);
127 extern GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
128 const int *attrib_list, int *nelements);
130 extern GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
131 int render_type, GLXContext share_list,
134 extern GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config,
135 const int *attrib_list);
137 extern GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config,
138 Pixmap pixmap, const int *attrib_list);
140 extern GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config,
141 Window win, const int *attrib_list);
143 extern void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
145 extern void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
147 extern void glXDestroyWindow(Display *dpy, GLXWindow win);
149 extern GLXDrawable glXGetCurrentReadDrawable(void);
151 extern int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
152 int attribute, int *value);
154 extern GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements);
156 extern void glXGetSelectedEvent(Display *dpy, GLXDrawable draw,
157 unsigned long *event_mask);
159 extern XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
161 extern Bool glXMakeContextCurrent(Display *display, GLXDrawable draw,
162 GLXDrawable read, GLXContext ctx);
164 extern int glXQueryContext(Display *dpy, GLXContext ctx,
165 int attribute, int *value);
167 extern void glXQueryDrawable(Display *dpy, GLXDrawable draw,
168 int attribute, unsigned int *value);
170 extern void glXSelectEvent(Display *dpy, GLXDrawable draw,
171 unsigned long event_mask);
176 extern void (*glXGetProcAddress(const GLubyte *procName))(void);
179 /**********************************************************************/
182 * ARB_get_proc_address
184 extern void (*glXGetProcAddressARB(const GLubyte *procName))(void);
189 extern Display *glXGetCurrentDisplayEXT(void);
191 extern void glXFreeContextEXT(Display *dpy, GLXContext ctx);
193 extern GLXContextID glXGetContextIDEXT(const GLXContext ctx);
195 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
197 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext ctx,
198 int attribute, int *value);
201 * NV_vertex_array_range
203 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
204 GLfloat writefreq, GLfloat priority);
206 extern void glXFreeMemoryNV(GLvoid *pointer);
211 extern int glXGetVideoSyncSGI(unsigned int *count);
213 extern int glXWaitVideoSyncSGI(int divisor, int remainder,
214 unsigned int *count);
216 extern int glXGetRefreshRateSGI(unsigned int *rate);
222 extern int glXSwapIntervalSGI(int interval);
228 extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
231 extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
233 extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
234 GLuint *group, GLuint *barrier);
236 extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
237 GLuint *maxGroups, GLuint *maxBarriers);
239 extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
241 extern Bool glXResetFrameCountNV(Display *dpy, int screen);
248 extern int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices,
249 GLXVideoDeviceNV *pVideoDevice);
251 extern int glXReleaseVideoDeviceNV(Display *dpy, int screen,
252 GLXVideoDeviceNV VideoDevice);
254 extern int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice,
255 GLXPbuffer pbuf, int iVideoBuffer);
257 extern int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf);
259 extern int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf,
261 unsigned long *pulCounterPbuffer,
264 extern int glXGetVideoInfoNV(Display *dpy, int screen,
265 GLXVideoDeviceNV VideoDevice,
266 unsigned long *pulCounterOutputVideo,
267 unsigned long *pulCounterOutputPbuffer);
274 extern int glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
275 int attribute, int *value_return);
277 extern GLXFBConfigSGIX *glXChooseFBConfigSGIX(Display *dpy, int screen,
278 const int *attrib_list,
281 extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
282 GLXFBConfigSGIX config,
285 extern GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
286 GLXFBConfigSGIX config,
288 GLXContext share_list,
291 extern XVisualInfo *glXGetVisualFromFBConfigSGIX(Display *dpy,
292 GLXFBConfigSGIX config);
294 extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
300 extern GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config,
303 const int *attrib_list);
305 extern void glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf);
307 extern void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf,
308 int attribute, unsigned int *value);
310 extern void glXSelectEventSGIX(Display *dpy, GLXDrawable drawable,
313 extern void glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable,
314 unsigned long *mask);
317 * EXT_texture_from_pixmap
319 extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer,
320 const int *attrib_list);
321 extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
326 extern int glXBindVideoDeviceNV(Display *dpy, unsigned int video_slot,
327 unsigned int video_device,
328 const int *attrib_list);
330 extern unsigned int *glXEnumerateVideoDevicesNV(Display *dpy, int screen,
335 extern int glXBindChannelToWindowSGIX(Display *display,
336 int screen, int channel, Window window);
338 extern int glXChannelRectSGIX(Display *display, int screen, int channel,
339 int x, int y, int w, int h);
341 extern int glXQueryChannelRectSGIX(Display *display, int screen, int channel,
342 int *dx, int *dy, int *dw, int *dh);
344 extern int glXQueryChannelDeltasSGIX(Display *display, int screen, int channel,
345 int *x, int *y, int *w, int *h);
347 extern int glXChannelRectSyncSGIX(Display *display, int screen, int channel,
353 extern GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
354 GLXContext share_list,
356 const int *attrib_list);
358 /**********************************************************************/
360 /*** Should these go here, or in another header? */
365 int event_type; /* GLX_DAMAGED or GLX_SAVED */
366 int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
367 unsigned long serial; /* # of last request processed by server */
368 Bool send_event; /* true if this came for SendEvent request */
369 Display *display; /* display the event was read from */
370 GLXDrawable drawable; /* XID of Drawable */
371 unsigned int buffer_mask; /* mask indicating which buffers are affected */
372 unsigned int aux_buffer; /* which aux buffer was affected */
375 int count; /* if nonzero, at least this many more */
376 } GLXPbufferClobberEvent;
378 typedef union __GLXEvent {
379 GLXPbufferClobberEvent glxpbufferclobber;
387 #endif /* !__glx_h__ */