00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _glxapi_h_
00027 #define _glxapi_h_
00028
00029
00030 #define GLX_GLXEXT_PROTOTYPES
00031 #include "GL/glx.h"
00032
00033
00034
00035
00036
00037
00038
00039 typedef struct __GLXcontextRec {
00040 Display *currentDpy;
00041 GLboolean isDirect;
00042 GLXDrawable currentDrawable;
00043 GLXDrawable currentReadable;
00044 XID xid;
00045 } __GLXcontext;
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 struct _glxapi_table {
00063
00064 XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
00065 void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
00066 GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
00067 GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
00068 void (*DestroyContext)(Display *dpy, GLXContext ctx);
00069 void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
00070 int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
00071
00072
00073 Bool (*IsDirect)(Display *dpy, GLXContext ctx);
00074 Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
00075 Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
00076 Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
00077 void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
00078 void (*UseXFont)(Font font, int first, int count, int listBase);
00079 void (*WaitGL)(void);
00080 void (*WaitX)(void);
00081
00082
00083 const char *(*GetClientString)(Display *dpy, int name);
00084 const char *(*QueryExtensionsString)(Display *dpy, int screen);
00085 const char *(*QueryServerString)(Display *dpy, int screen, int name);
00086
00087
00088
00089
00090
00091 GLXFBConfig *(*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
00092 GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
00093 GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
00094 GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
00095 GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
00096 void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
00097 void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
00098 void (*DestroyWindow)(Display *dpy, GLXWindow window);
00099
00100 int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
00101 GLXFBConfig *(*GetFBConfigs)(Display *dpy, int screen, int *nelements);
00102 void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
00103 XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
00104 Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
00105 int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
00106 void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
00107 void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
00108
00109
00110 int (*SwapIntervalSGI)(int);
00111
00112
00113 int (*GetVideoSyncSGI)(unsigned int *count);
00114 int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
00115
00116
00117 Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
00118
00119
00120
00121 #if defined(_VL_H_)
00122 GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
00123 void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
00124 #else
00125 void *CreateGLXVideoSourceSGIX;
00126 void *DestroyGLXVideoSourceSGIX;
00127 #endif
00128
00129
00130 void (*FreeContextEXT)(Display *dpy, GLXContext context);
00131 GLXContextID (*GetContextIDEXT)(const GLXContext context);
00132
00133 GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
00134 int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
00135
00136
00137 int (*GetFBConfigAttribSGIX)(Display *, GLXFBConfigSGIX, int, int *);
00138 GLXFBConfigSGIX * (*ChooseFBConfigSGIX)(Display *, int, int *, int *);
00139 GLXPixmap (*CreateGLXPixmapWithConfigSGIX)(Display *, GLXFBConfigSGIX, Pixmap);
00140 GLXContext (*CreateContextWithConfigSGIX)(Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
00141 XVisualInfo * (*GetVisualFromFBConfigSGIX)(Display *, GLXFBConfigSGIX);
00142 GLXFBConfigSGIX (*GetFBConfigFromVisualSGIX)(Display *, XVisualInfo *);
00143
00144
00145 GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
00146 void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
00147 int (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
00148 void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
00149 void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
00150
00151
00152 void (*CushionSGI)(Display *, Window, float);
00153
00154
00155 int (*BindChannelToWindowSGIX)(Display *, int, int, Window);
00156 int (*ChannelRectSGIX)(Display *, int, int, int, int, int, int);
00157 int (*QueryChannelRectSGIX)(Display *, int, int, int *, int *, int *, int *);
00158 int (*QueryChannelDeltasSGIX)(Display *, int, int, int *, int *, int *, int *);
00159 int (*ChannelRectSyncSGIX)(Display *, int, int, GLenum);
00160
00161
00162 #if defined (_DM_BUFFER_H_)
00163 Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
00164 #else
00165 void *AssociciateDMPbufferSGIX;
00166 #endif
00167
00168
00169 void (*JoinSwapGroupSGIX)(Display *, GLXDrawable, GLXDrawable);
00170
00171
00172 void (*BindSwapBarrierSGIX)(Display *, GLXDrawable, int);
00173 Bool (*QueryMaxSwapBarriersSGIX)(Display *, int, int *);
00174
00175
00176 Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *);
00177
00178
00179 void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
00180
00181
00182 Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
00183
00184
00185 GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
00186
00187
00188 Bool (*Set3DfxModeMESA)(int mode);
00189
00190
00191 void * (*AllocateMemoryNV)( GLsizei size,
00192 GLfloat readFrequency,
00193 GLfloat writeFrequency,
00194 GLfloat priority );
00195 void (*FreeMemoryNV)( GLvoid *pointer );
00196
00197
00198 GLuint (*GetAGPOffsetMESA)( const GLvoid *pointer );
00199
00200
00201 void (*BindTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer,
00202 const int *attrib_list);
00203 void (*ReleaseTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer);
00204 };
00205
00206
00207
00208 extern const char *
00209 _glxapi_get_version(void);
00210
00211
00212 extern const char **
00213 _glxapi_get_extensions(void);
00214
00215
00216 extern GLuint
00217 _glxapi_get_dispatch_table_size(void);
00218
00219
00220 extern void
00221 _glxapi_set_no_op_table(struct _glxapi_table *t);
00222
00223
00224 extern __GLXextFuncPtr
00225 _glxapi_get_proc_address(const char *funcName);
00226
00227
00228 #endif