#ifndef _glxapi_h_
#define _glxapi_h_
#define GLX_GLXEXT_PROTOTYPES
#include "GL/glx.h"
#ifdef GLX_BUILT_IN_XMESA
#include "glxclient.h"
#else
typedef struct __GLXcontextRec {
Display *currentDpy;
GLboolean isDirect;
GLXDrawable currentDrawable;
GLXDrawable currentReadable;
XID xid;
} __GLXcontext;
#endif
struct _glxapi_table {
XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
void (*DestroyContext)(Display *dpy, GLXContext ctx);
void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
Bool (*IsDirect)(Display *dpy, GLXContext ctx);
Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
void (*UseXFont)(Font font, int first, int count, int listBase);
void (*WaitGL)(void);
void (*WaitX)(void);
const char *(*GetClientString)(Display *dpy, int name);
const char *(*QueryExtensionsString)(Display *dpy, int screen);
const char *(*QueryServerString)(Display *dpy, int screen, int name);
GLXFBConfig *(*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
void (*DestroyWindow)(Display *dpy, GLXWindow window);
int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
GLXFBConfig *(*GetFBConfigs)(Display *dpy, int screen, int *nelements);
void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
int (*SwapIntervalSGI)(int);
int (*GetVideoSyncSGI)(unsigned int *count);
int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
#if defined(_VL_H_)
GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
#else
void *CreateGLXVideoSourceSGIX;
void *DestroyGLXVideoSourceSGIX;
#endif
void (*FreeContextEXT)(Display *dpy, GLXContext context);
GLXContextID (*GetContextIDEXT)(const GLXContext context);
GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
int (*GetFBConfigAttribSGIX)(Display *, GLXFBConfigSGIX, int, int *);
GLXFBConfigSGIX * (*ChooseFBConfigSGIX)(Display *, int, int *, int *);
GLXPixmap (*CreateGLXPixmapWithConfigSGIX)(Display *, GLXFBConfigSGIX, Pixmap);
GLXContext (*CreateContextWithConfigSGIX)(Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
XVisualInfo * (*GetVisualFromFBConfigSGIX)(Display *, GLXFBConfigSGIX);
GLXFBConfigSGIX (*GetFBConfigFromVisualSGIX)(Display *, XVisualInfo *);
GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
int (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
void (*CushionSGI)(Display *, Window, float);
int (*BindChannelToWindowSGIX)(Display *, int, int, Window);
int (*ChannelRectSGIX)(Display *, int, int, int, int, int, int);
int (*QueryChannelRectSGIX)(Display *, int, int, int *, int *, int *, int *);
int (*QueryChannelDeltasSGIX)(Display *, int, int, int *, int *, int *, int *);
int (*ChannelRectSyncSGIX)(Display *, int, int, GLenum);
#if defined (_DM_BUFFER_H_)
Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
#else
void *AssociciateDMPbufferSGIX;
#endif
void (*JoinSwapGroupSGIX)(Display *, GLXDrawable, GLXDrawable);
void (*BindSwapBarrierSGIX)(Display *, GLXDrawable, int);
Bool (*QueryMaxSwapBarriersSGIX)(Display *, int, int *);
Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *);
void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
Bool (*Set3DfxModeMESA)(int mode);
void * (*AllocateMemoryNV)( GLsizei size,
GLfloat readFrequency,
GLfloat writeFrequency,
GLfloat priority );
void (*FreeMemoryNV)( GLvoid *pointer );
GLuint (*GetAGPOffsetMESA)( const GLvoid *pointer );
};
extern const char *
_glxapi_get_version(void);
extern const char **
_glxapi_get_extensions(void);
extern GLuint
_glxapi_get_dispatch_table_size(void);
extern void
_glxapi_set_no_op_table(struct _glxapi_table *t);
extern const GLvoid *
_glxapi_get_proc_address(const char *funcName);
#endif