00001 #ifndef __glx_h__
00002 #define __glx_h__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <X11/Xlib.h>
00026 #include <X11/Xutil.h>
00027 #include <X11/Xmd.h>
00028 #include <GL/gl.h>
00029 #include <GL/glxtokens.h>
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035
00036
00037
00038 typedef XID GLXContextID;
00039 typedef XID GLXPixmap;
00040 typedef XID GLXDrawable;
00041 typedef XID GLXPbuffer;
00042 typedef XID GLXWindow;
00043 typedef XID GLXFBConfigID;
00044
00045
00046
00047
00048 typedef struct __GLXcontextRec *GLXContext;
00049
00050
00051
00052
00053 typedef struct __GLXFBConfigRec *GLXFBConfig;
00054 typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
00055
00056
00057
00058
00059
00060
00061
00062 extern XVisualInfo* glXChooseVisual(Display *dpy, int screen,
00063 int *attrib_list);
00064
00065 extern void glXCopyContext(Display *dpy, GLXContext src,
00066 GLXContext dst, unsigned long mask);
00067
00068 extern GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
00069 GLXContext share_list, Bool direct);
00070
00071 extern GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
00072 Pixmap pixmap);
00073
00074 extern void glXDestroyContext(Display *dpy, GLXContext ctx);
00075
00076 extern void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix);
00077
00078 extern int glXGetConfig(Display *dpy, XVisualInfo *vis,
00079 int attrib, int *value);
00080
00081 extern GLXContext glXGetCurrentContext(void);
00082
00083 extern GLXDrawable glXGetCurrentDrawable(void);
00084
00085 extern Bool glXIsDirect(Display *dpy, GLXContext ctx);
00086
00087 extern Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable,
00088 GLXContext ctx);
00089
00090 extern Bool glXQueryExtension(Display *dpy, int *error_base, int *event_base);
00091
00092 extern Bool glXQueryVersion(Display *dpy, int *major, int *minor);
00093
00094 extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable);
00095
00096 extern void glXUseXFont(Font font, int first, int count, int list_base);
00097
00098 extern void glXWaitGL(void);
00099
00100 extern void glXWaitX(void);
00101
00102
00103
00104
00105
00106 extern const char *glXGetClientString(Display *dpy, int name);
00107
00108 extern const char *glXQueryServerString(Display *dpy, int screen, int name);
00109
00110 extern const char *glXQueryExtensionsString(Display *dpy, int screen);
00111
00112
00113
00114
00115
00116 extern Display *glXGetCurrentDisplay(void);
00117
00118
00119
00120
00121
00122 extern GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
00123 const int *attrib_list, int *nelements);
00124
00125 extern GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
00126 int render_type, GLXContext share_list,
00127 Bool direct);
00128
00129 extern GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config,
00130 const int *attrib_list);
00131
00132 extern GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config,
00133 Pixmap pixmap, const int *attrib_list);
00134
00135 extern GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config,
00136 Window win, const int *attrib_list);
00137
00138 extern void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
00139
00140 extern void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
00141
00142 extern void glXDestroyWindow(Display *dpy, GLXWindow win);
00143
00144 extern GLXDrawable glXGetCurrentReadDrawable(void);
00145
00146 extern int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
00147 int attribute, int *value);
00148
00149 extern GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements);
00150
00151 extern void glXGetSelectedEvent(Display *dpy, GLXDrawable draw,
00152 unsigned long *event_mask);
00153
00154 extern XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
00155
00156 extern Bool glXMakeContextCurrent(Display *display, GLXDrawable draw,
00157 GLXDrawable read, GLXContext ctx);
00158
00159 extern int glXQueryContext(Display *dpy, GLXContext ctx,
00160 int attribute, int *value);
00161
00162 extern void glXQueryDrawable(Display *dpy, GLXDrawable draw,
00163 int attribute, unsigned int *value);
00164
00165 extern void glXSelectEvent(Display *dpy, GLXDrawable draw,
00166 unsigned long event_mask);
00167
00168
00169
00170
00171
00172
00173
00174 extern void (*glXGetProcAddressARB(const GLubyte *procName))(void);
00175
00176
00177
00178
00179 extern void glXFreeContextEXT(Display *dpy, GLXContext ctx);
00180
00181 extern GLXContextID glXGetContextIDEXT(const GLXContext ctx);
00182
00183 extern GLXDrawable glXGetCurrentDrawableEXT(void);
00184
00185 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
00186
00187 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext ctx,
00188 int attribute, int *value);
00189
00190
00191
00192
00193 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
00194 GLfloat writefreq, GLfloat priority);
00195
00196 extern void glXFreeMemoryNV(GLvoid *pointer);
00197
00198
00199
00200
00201 extern int glXGetVideoSyncSGI(unsigned int *count);
00202
00203 extern int glXWaitVideoSyncSGI(int divisor, int remainder,
00204 unsigned int *count);
00205
00206 extern int glXGetRefreshRateSGI(unsigned int *rate);
00207
00208
00209
00210
00211
00212 extern int glXSwapIntervalSGI(int interval);
00213
00214
00215
00216
00217
00218 extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
00219 GLuint group);
00220
00221 extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
00222
00223 extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
00224 GLuint *group, GLuint *barrier);
00225
00226 extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
00227 GLuint *maxGroups, GLuint *maxBarriers);
00228
00229 extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
00230
00231 extern Bool glXResetFrameCountNV(Display *dpy, int screen);
00232
00233
00234
00235
00236
00237
00238 extern int glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
00239 int attribute, int *value_return);
00240
00241 extern GLXFBConfigSGIX *glXChooseFBConfigSGIX(Display *dpy, int screen,
00242 const int *attrib_list,
00243 int *nelements);
00244
00245 extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
00246 GLXFBConfigSGIX config,
00247 Pixmap pixmap);
00248
00249 extern GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
00250 GLXFBConfigSGIX config,
00251 int render_type,
00252 GLXContext share_list,
00253 Bool direct);
00254
00255 extern XVisualInfo *glXGetVisualFromFBConfigSGIX(Display *dpy,
00256 GLXFBConfigSGIX config);
00257
00258 extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
00259 XVisualInfo *vis);
00260
00261
00262
00263
00264 extern GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config,
00265 unsigned int width,
00266 unsigned int height,
00267 const int *attrib_list);
00268
00269 extern void glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf);
00270
00271 extern void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf,
00272 int attribute, unsigned int *value);
00273
00274 extern void glXSelectEventSGIX(Display *dpy, GLXDrawable drawable,
00275 unsigned long mask);
00276
00277 extern void glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable,
00278 unsigned long *mask);
00279
00280
00281
00282
00283
00284
00285
00286
00287 typedef struct {
00288 int event_type;
00289 int draw_type;
00290 unsigned long serial;
00291 Bool send_event;
00292 Display *display;
00293 GLXDrawable drawable;
00294 unsigned int buffer_mask;
00295 unsigned int aux_buffer;
00296 int x, y;
00297 int width, height;
00298 int count;
00299 } GLXPbufferClobberEvent;
00300
00301 typedef union __GLXEvent {
00302 GLXPbufferClobberEvent glxpbufferclobber;
00303 long pad[24];
00304 } GLXEvent;
00305
00306 #ifdef __cplusplus
00307 }
00308 #endif
00309
00310 #endif