-/* $Id: fakeglx.c,v 1.51 2001/05/24 20:05:32 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.52 2001/05/25 21:51:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
MakeCurrent_PrevReadable = 0;
MakeCurrent_PrevDrawBuffer = 0;
MakeCurrent_PrevReadBuffer = 0;
+#ifdef GLX_BUILD_IN_XLIB_MESA
+ /* XXX bind dummy context with __glXSetCurrentContext(ctx); */
+#endif
return True;
}
else {
}
-#ifdef GLX_MESA_pixmap_colormap
+/*** GLX_MESA_pixmap_colormap ***/
+
static GLXPixmap
Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
Pixmap pixmap, Colormap cmap )
}
return b->frontbuffer;
}
-#endif
static void
-#ifdef GLX_MESA_copy_sub_buffer
+/*** GLX_MESA_copy_sub_buffer ***/
+
static void
Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
int x, int y, int width, int height )
fprintf(stderr, "Mesa Warning: glXCopySubBufferMESA: invalid drawable\n");
}
}
-#endif
-#ifdef GLX_SGI_swap_control
+/*** GLX_SGI_swap_control ***/
static int
Fake_glXSwapIntervalSGI(int interval)
return 0;
}
-#endif
-#ifdef GLX_SGI_video_sync
+/*** GLX_SGI_video_sync ***/
static int
Fake_glXGetVideoSyncSGI(unsigned int *count)
return 0;
}
-#endif
-#ifdef GLX_SGI_make_current_read
+/*** GLX_SGI_make_current_read ***/
static Bool
Fake_glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
/* not used
static GLXDrawable
-make_glXGetCurrentReadDrawableSGI(void)
+Fake_glXGetCurrentReadDrawableSGI(void)
{
return 0;
}
*/
-#endif
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
+/*** GLX_SGIX_video_source ***/
+#if defined(_VL_H)
static GLXVideoSourceSGIX
Fake_glXCreateGLXVideoSourceSGIX(Display *dpy, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
#endif
-#ifdef GLX_EXT_import_context
+/*** GLX_EXT_import_context ***/
static void
Fake_glXFreeContextEXT(Display *dpy, GLXContext context)
return 0;
}
-#endif
-#ifdef GLX_SGIX_fbconfig
+/*** GLX_SGIX_fbconfig ***/
static int
Fake_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
return 0;
}
-#endif
-#ifdef GLX_SGIX_pbuffer
+/*** GLX_SGIX_pbuffer ***/
static GLXPbufferSGIX
Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list)
(void) mask;
}
-#endif
-#ifdef GLX_SGI_cushion
+/*** GLX_SGI_cushion ***/
static void
Fake_glXCushionSGI(Display *dpy, Window win, float cushion)
(void) cushion;
}
-#endif
-#ifdef GLX_SGIX_video_resize
+/*** GLX_SGIX_video_resize ***/
static int
Fake_glXBindChannelToWindowSGIX(Display *dpy, int screen, int channel , Window window)
return 0;
}
-#endif
-#if defined(_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
+/*** GLX_SGIX_dmbuffer **/
+#if defined(_DM_BUFFER_H_)
static Bool
Fake_glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer)
{
(void) dmbuffer;
return False;
}
-
#endif
-#ifdef GLX_SGIX_swap_group
+/*** GLX_SGIX_swap_group ***/
static void
Fake_glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
(void) member;
}
-#endif
-#ifdef GLX_SGIX_swap_barrier
+/*** GLX_SGIX_swap_barrier ***/
static void
Fake_glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
return False;
}
-#endif
-#ifdef GLX_SUN_get_transparent_index
+/*** GLX_SUN_get_transparent_index ***/
static Status
Fake_glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent)
return 0;
}
-#endif
-#ifdef GLX_MESA_release_buffers
+/*** GLX_MESA_release_buffers ***/
+
/*
* Release the depth, stencil, accum buffers attached to a GLXDrawable
* (a window or pixmap) prior to destroying the GLXDrawable.
}
return False;
}
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+/*** GLX_MESA_set_3dfx_mode ***/
+
static Bool
Fake_glXSet3DfxModeMESA( int mode )
{
return XMesaSetFXmode( mode );
}
-#endif
glx.WaitGL = Fake_glXWaitGL;
glx.WaitX = Fake_glXWaitX;
-#ifdef GLX_VERSION_1_1
+ /*** GLX_VERSION_1_1 ***/
glx.GetClientString = Fake_glXGetClientString;
glx.QueryExtensionsString = Fake_glXQueryExtensionsString;
glx.QueryServerString = Fake_glXQueryServerString;
-#endif
-#ifdef GLX_VERSION_1_2
+ /*** GLX_VERSION_1_2 ***/
/*glx.GetCurrentDisplay = Fake_glXGetCurrentDisplay;*/
-#endif
-#ifdef GLX_VERSION_1_3
+ /*** GLX_VERSION_1_3 ***/
glx.ChooseFBConfig = Fake_glXChooseFBConfig;
glx.CreateNewContext = Fake_glXCreateNewContext;
glx.CreatePbuffer = Fake_glXCreatePbuffer;
glx.QueryContext = Fake_glXQueryContext;
glx.QueryDrawable = Fake_glXQueryDrawable;
glx.SelectEvent = Fake_glXSelectEvent;
-#endif
-#ifdef GLX_SGI_swap_control
+ /*** GLX_SGI_swap_control ***/
glx.SwapIntervalSGI = Fake_glXSwapIntervalSGI;
-#endif
-#ifdef GLX_SGI_video_sync
+ /*** GLX_SGI_video_sync ***/
glx.GetVideoSyncSGI = Fake_glXGetVideoSyncSGI;
glx.WaitVideoSyncSGI = Fake_glXWaitVideoSyncSGI;
-#endif
-#ifdef GLX_SGI_make_current_read
+ /*** GLX_SGI_make_current_read ***/
glx.MakeCurrentReadSGI = Fake_glXMakeCurrentReadSGI;
/*glx.GetCurrentReadDrawableSGI = Fake_glXGetCurrentReadDrawableSGI;*/
-#endif
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
+/*** GLX_SGIX_video_source ***/
+#if defined(_VL_H)
glx.CreateGLXVideoSourceSGIX = Fake_glXCreateGLXVideoSourceSGIX;
glx.DestroyGLXVideoSourceSGIX = Fake_glXDestroyGLXVideoSourceSGIX;
#endif
-#ifdef GLX_EXT_import_context
+ /*** GLX_EXT_import_context ***/
glx.FreeContextEXT = Fake_glXFreeContextEXT;
glx.GetContextIDEXT = Fake_glXGetContextIDEXT;
/*glx.GetCurrentDisplayEXT = Fake_glXGetCurrentDisplayEXT;*/
glx.ImportContextEXT = Fake_glXImportContextEXT;
glx.QueryContextInfoEXT = Fake_glXQueryContextInfoEXT;
-#endif
-#ifdef GLX_SGIX_fbconfig
+ /*** GLX_SGIX_fbconfig ***/
glx.GetFBConfigAttribSGIX = Fake_glXGetFBConfigAttribSGIX;
glx.ChooseFBConfigSGIX = Fake_glXChooseFBConfigSGIX;
glx.CreateGLXPixmapWithConfigSGIX = Fake_glXCreateGLXPixmapWithConfigSGIX;
glx.CreateContextWithConfigSGIX = Fake_glXCreateContextWithConfigSGIX;
glx.GetVisualFromFBConfigSGIX = Fake_glXGetVisualFromFBConfigSGIX;
glx.GetFBConfigFromVisualSGIX = Fake_glXGetFBConfigFromVisualSGIX;
-#endif
-#ifdef GLX_SGIX_pbuffer
+ /*** GLX_SGIX_pbuffer ***/
glx.CreateGLXPbufferSGIX = Fake_glXCreateGLXPbufferSGIX;
glx.DestroyGLXPbufferSGIX = Fake_glXDestroyGLXPbufferSGIX;
glx.QueryGLXPbufferSGIX = Fake_glXQueryGLXPbufferSGIX;
glx.SelectEventSGIX = Fake_glXSelectEventSGIX;
glx.GetSelectedEventSGIX = Fake_glXGetSelectedEventSGIX;
-#endif
-#ifdef GLX_SGI_cushion
+ /*** GLX_SGI_cushion ***/
glx.CushionSGI = Fake_glXCushionSGI;
-#endif
-#ifdef GLX_SGIX_video_resize
+ /*** GLX_SGIX_video_resize ***/
glx.BindChannelToWindowSGIX = Fake_glXBindChannelToWindowSGIX;
glx.ChannelRectSGIX = Fake_glXChannelRectSGIX;
glx.QueryChannelRectSGIX = Fake_glXQueryChannelRectSGIX;
glx.QueryChannelDeltasSGIX = Fake_glXQueryChannelDeltasSGIX;
glx.ChannelRectSyncSGIX = Fake_glXChannelRectSyncSGIX;
-#endif
-#if defined(_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
+ /*** GLX_SGIX_dmbuffer **/
+#if defined(_DM_BUFFER_H_)
glx.AssociateDMPbufferSGIX = NULL;
#endif
-#ifdef GLX_SGIX_swap_group
+ /*** GLX_SGIX_swap_group ***/
glx.JoinSwapGroupSGIX = Fake_glXJoinSwapGroupSGIX;
-#endif
-#ifdef GLX_SGIX_swap_barrier
+ /*** GLX_SGIX_swap_barrier ***/
glx.BindSwapBarrierSGIX = Fake_glXBindSwapBarrierSGIX;
glx.QueryMaxSwapBarriersSGIX = Fake_glXQueryMaxSwapBarriersSGIX;
-#endif
-#ifdef GLX_SUN_get_transparent_index
+ /*** GLX_SUN_get_transparent_index ***/
glx.GetTransparentIndexSUN = Fake_glXGetTransparentIndexSUN;
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+ /*** GLX_MESA_copy_sub_buffer ***/
glx.CopySubBufferMESA = Fake_glXCopySubBufferMESA;
-#endif
-#ifdef GLX_MESA_release_buffers
+ /*** GLX_MESA_release_buffers ***/
glx.ReleaseBuffersMESA = Fake_glXReleaseBuffersMESA;
-#endif
-#ifdef GLX_MESA_pixmap_colormap
+ /*** GLX_MESA_pixmap_colormap ***/
glx.CreateGLXPixmapMESA = Fake_glXCreateGLXPixmapMESA;
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+ /*** GLX_MESA_set_3dfx_mode ***/
glx.Set3DfxModeMESA = Fake_glXSet3DfxModeMESA;
-#endif
return &glx;
}
-/* $Id: glxapi.c,v 1.23 2001/05/24 20:05:32 brianp Exp $ */
+/* $Id: glxapi.c,v 1.24 2001/05/25 21:51:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* This is the GLX API dispatcher. Calls to the glX* functions are
- * either routed to real (SGI / Utah) GLX encoders or to Mesa's
- * pseudo-GLX module.
+ * either routed to the real GLX encoders or to Mesa's pseudo-GLX functions.
*/
#include "glxapi.h"
-/*
- * XXX - this really shouldn't be here.
- * Instead, add -DUSE_MESA_GLX to the compiler flags when needed.
- */
-#define USE_MESA_GLX 1
-
-
-/* Rather than include possibly non-existant headers... */
-#ifdef USE_SGI_GLX
-extern struct _glxapi_table *_sgi_GetGLXDispatchTable(void);
-#endif
-#ifdef USE_UTAH_GLX
-extern struct _glxapi_table *_utah_GetGLXDispatchTable(void);
-#endif
-#ifdef USE_MESA_GLX
+extern struct _glxapi_table *_real_GetGLXDispatchTable(void);
extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
-#endif
-
struct display_dispatch {
}
}
- /* A new display, determine if we should use real GLX (SGI / Utah)
+ /* A new display, determine if we should use real GLX
* or Mesa's pseudo-GLX.
*/
{
struct _glxapi_table *t = NULL;
-#if defined(USE_SGI_GLX) || defined(USE_UTAH_GLX)
- if (!getenv("MESA_FORCE_SOFTX")) {
+#ifdef GLX_BUILD_IN_XLIB_MESA
+ if (!getenv("LIBGL_FORCE_XMESA")) {
int ignore;
if (XQueryExtension( dpy, "GLX", &ignore, &ignore, &ignore )) {
/* the X server has the GLX extension */
-#if defined(USE_SGI_GLX)
- t = _sgi_GetGLXDispatchTable();
-#elif defined(USE_UTAH_GLX)
- t = _utah_GetGLXDispatchTable();
-#endif
+ t = _real_GetGLXDispatchTable();
}
}
#endif
-#if defined(USE_MESA_GLX)
if (!t) {
+ /* Fallback to Mesa with Xlib driver */
+#ifdef GLX_BUILD_IN_XLIB_MESA
+ if (getenv("LIBGL_DEBUG")) {
+ fprintf(stderr,
+ "libGL: server lacks GLX extension. Using Mesa Xlib renderer.");
+ }
+#endif
t = _mesa_GetGLXDispatchTable();
assert(t); /* this has to work */
}
-#endif
if (t) {
struct display_dispatch *d;
* GLX API entrypoints
*/
+/*** GLX_VERSION_1_0 ***/
XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *list)
{
#endif
+#ifdef GLX_BUILD_IN_XLIB_MESA
+/* Use real libGL's glXGetCurrentContext() function */
+#else
+/* stand-alone Mesa */
GLXDrawable glXGetCurrentDrawable(void)
{
__GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
return gc ? gc->currentDrawable : 0;
}
+#endif
Bool glXIsDirect(Display *dpy, GLXContext ctx)
-#ifdef GLX_VERSION_1_1
+/*** GLX_VERSION_1_1 ***/
const char *glXGetClientString(Display *dpy, int name)
{
return (t->QueryServerString)(dpy, screen, name);
}
-#endif
-
+/*** GLX_VERSION_1_2 ***/
-#ifdef GLX_VERSION_1_2
+#if !defined(GLX_BUILD_IN_XLIB_MESA)
Display *glXGetCurrentDisplay(void)
{
/* Same code as in libGL's glxext.c */
-#ifdef GLX_VERSION_1_3
+/*** GLX_VERSION_1_3 ***/
GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
{
}
+#ifdef GLX_BUILD_IN_XLIB_MESA
+/* Use the glXGetCurrentReadDrawable() function from libGL */
+#else
GLXDrawable glXGetCurrentReadDrawable(void)
{
__GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
return gc ? gc->currentReadable : 0;
}
+#endif
int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value)
if (!t)
return False;
b = (t->MakeContextCurrent)(dpy, draw, read, ctx);
-#ifndef GLX_BUILD_IN_XLIB_MESA
+#ifndef GLX_BUILD_IN_XLIB_MESA
if (b) {
CurrentContext = ctx;
}
(t->SelectEvent)(dpy, drawable, mask);
}
-#endif /* GLX_VERSION_1_3 */
-#ifdef GLX_SGI_swap_control
+/*** GLX_SGI_swap_control ***/
int glXSwapIntervalSGI(int interval)
{
return (t->SwapIntervalSGI)(interval);
}
-#endif
-#ifdef GLX_SGI_video_sync
+/*** GLX_SGI_video_sync ***/
int glXGetVideoSyncSGI(unsigned int *count)
{
return (t->WaitVideoSyncSGI)(divisor, remainder, count);
}
-#endif
-#ifdef GLX_SGI_make_current_read
+/*** GLX_SGI_make_current_read ***/
Bool glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
{
return (t->MakeCurrentReadSGI)(dpy, draw, read, ctx);
}
+#ifdef GLX_BUILD_IN_XLIB_MESA
+/* Use glXGetCurrentReadDrawableSGI() from libGL */
+#else
+/* stand-alone Mesa */
GLXDrawable glXGetCurrentReadDrawableSGI(void)
{
return glXGetCurrentReadDrawable();
#endif
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
+#if defined(_VL_H)
GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX(Display *dpy, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode)
{
#endif
-#ifdef GLX_EXT_import_context
+/*** GLX_EXT_import_context ***/
void glXFreeContextEXT(Display *dpy, GLXContext context)
{
return (t->QueryContextInfoEXT)(dpy, context, attribute, value);
}
-#endif
-#ifdef GLX_SGIX_fbconfig
+/*** GLX_SGIX_fbconfig ***/
int glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
{
return (t->GetFBConfigFromVisualSGIX)(dpy, vis);
}
-#endif
-#ifdef GLX_SGIX_pbuffer
+/*** GLX_SGIX_pbuffer ***/
GLXPbufferSGIX glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list)
{
(t->GetSelectedEventSGIX)(dpy, drawable, mask);
}
-#endif
-#ifdef GLX_SGI_cushion
+/*** GLX_SGI_cushion ***/
void glXCushionSGI(Display *dpy, Window win, float cushion)
{
(t->CushionSGI)(dpy, win, cushion);
}
-#endif
-#ifdef GLX_SGIX_video_resize
+/*** GLX_SGIX_video_resize ***/
int glXBindChannelToWindowSGIX(Display *dpy, int screen, int channel , Window window)
{
return (t->ChannelRectSyncSGIX)(dpy, screen, channel, synctype);
}
-#endif
-#if defined(_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
+#if defined(_DM_BUFFER_H_)
Bool glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer)
{
#endif
-#ifdef GLX_SGIX_swap_group
+/*** GLX_SGIX_swap_group ***/
void glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
{
(*t->JoinSwapGroupSGIX)(dpy, drawable, member);
}
-#endif
-
-#ifdef GLX_SGIX_swap_barrier
+/*** GLX_SGIX_swap_barrier ***/
void glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
{
return (*t->QueryMaxSwapBarriersSGIX)(dpy, screen, max);
}
-#endif
-#ifdef GLX_SUN_get_transparent_index
+/*** GLX_SUN_get_transparent_index ***/
Status glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent)
{
return (*t->GetTransparentIndexSUN)(dpy, overlay, underlay, pTransparent);
}
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+/*** GLX_MESA_copy_sub_buffer ***/
void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height)
{
(t->CopySubBufferMESA)(dpy, drawable, x, y, width, height);
}
-#endif
-#ifdef GLX_MESA_release_buffers
+/*** GLX_MESA_release_buffers ***/
Bool glXReleaseBuffersMESA(Display *dpy, Window w)
{
return (t->ReleaseBuffersMESA)(dpy, w);
}
-#endif
-#ifdef GLX_MESA_pixmap_colormap
+/*** GLX_MESA_pixmap_colormap ***/
GLXPixmap glXCreateGLXPixmapMESA(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap)
{
return (t->CreateGLXPixmapMESA)(dpy, visinfo, pixmap, cmap);
}
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+/*** GLX_MESA_set_3dfx_mode ***/
Bool glXSet3DfxModeMESA(int mode)
{
return (t->Set3DfxModeMESA)(mode);
}
-#endif
GET_OPT_FUNCTION(QueryContext, "glXQueryContext");
GET_OPT_FUNCTION(QueryDrawable, "glXQueryDrawable");
GET_OPT_FUNCTION(SelectEvent, "glXSelectEvent");
-#ifdef GLX_SGI_swap_control
+ /*** GLX_SGI_swap_control ***/
GET_OPT_FUNCTION(SwapIntervalSGI, "glXSwapIntervalSGI");
-#endif
-#ifdef GLX_SGI_video_sync
+ /*** GLX_SGI_video_sync ***/
GET_OPT_FUNCTION(GetVideoSyncSGI, "glXGetVideoSyncSGI");
GET_OPT_FUNCTION(WaitVideoSyncSGI, "glXWaitVideoSyncSGI");
-#endif
-#ifdef GLX_SGI_make_current_read
+ /*** GLX_SGI_make_current_read ***/
GET_OPT_FUNCTION(MakeCurrentReadSGI, "glXMakeCurrentReadSGI");
GET_OPT_FUNCTION(GetCurrentReadDrawableSGI, "glXGetCurrentReadDrawableSGI");
-#endif
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
+ /*** GLX_SGIX_video_source ***/
+#if defined(_VL_H)
GET_OPT_FUNCTION(CreateGLXVideoSourceSGIX, "glXCreateGLXVideoSourceSGIX");
GET_OPT_FUNCTION(DestroyGLXVideoSourceSGIX, "glXDestroyGLXVideoSourceSGIX");
#endif
-#ifdef GLX_EXT_import_context
+ /*** GLX_EXT_import_context ***/
GET_OPT_FUNCTION(FreeContextEXT, "glXFreeContextEXT");
GET_OPT_FUNCTION(GetContextIDEXT, "glXGetContextIDEXT");
GET_OPT_FUNCTION(GetCurrentDisplayEXT, "glXGetCurrentDisplayEXT");
GET_OPT_FUNCTION(ImportContextEXT, "glXImportContextEXT");
GET_OPT_FUNCTION(QueryContextInfoEXT, "glXQueryContextInfoEXT");
-#endif
-#ifdef GLX_SGIX_fbconfig
+ /*** GLX_SGIX_fbconfig ***/
GET_OPT_FUNCTION(GetFBConfigAttribSGIX, "glXGetFBConfigAttribSGIX");
GET_OPT_FUNCTION(ChooseFBConfigSGIX, "glXChooseFBConfigSGIX");
GET_OPT_FUNCTION(CreateGLXPixmapWithConfigSGIX, "glXCreateGLXPixmapWithConfigSGIX");
GET_OPT_FUNCTION(CreateContextWithConfigSGIX, "glXCreateContextWithConfigSGIX");
GET_OPT_FUNCTION(GetVisualFromFBConfigSGIX, "glXGetVisualFromFBConfigSGIX");
GET_OPT_FUNCTION(GetFBConfigFromVisualSGIX, "glXGetFBConfigFromVisualSGIX");
-#endif
-#ifdef GLX_SGIX_pbuffer
+ /*** GLX_SGIX_pbuffer ***/
GET_OPT_FUNCTION(CreateGLXPbufferSGIX, "glXCreateGLXPbufferSGIX");
GET_OPT_FUNCTION(DestroyGLXPbufferSGIX, "glXDestroyGLXPbufferSGIX");
GET_OPT_FUNCTION(QueryGLXPbufferSGIX, "glXQueryGLXPbufferSGIX");
GET_OPT_FUNCTION(SelectEventSGIX, "glXSelectEventSGIX");
GET_OPT_FUNCTION(GetSelectedEventSGIX, "glXGetSelectedEventSGIX");
-#endif
-#ifdef GLX_SGI_cushion
+ /*** GLX_SGI_cushion ***/
GET_OPT_FUNCTION(CushionSGI, "glXCushionSGI");
-#endif
-#ifdef GLX_SGIX_video_resize
+ /*** GLX_SGIX_video_resize ***/
GET_OPT_FUNCTION(BindChannelToWindowSGIX, "glXBindChannelToWindowSGIX");
GET_OPT_FUNCTION(ChannelRectSGIX, "glXChannelRectSGIX");
GET_OPT_FUNCTION(QueryChannelRectSGIX, "glXQueryChannelRectSGIX");
GET_OPT_FUNCTION(QueryChannelDeltasSGIX, "glXQueryChannelDeltasSGIX");
GET_OPT_FUNCTION(ChannelRectSyncSGIX, "glXChannelRectSyncSGIX");
-#endif
-#if defined (_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
+ /*** GLX_SGIX_dmbuffer ***/
+#if defined (_DM_BUFFER_H_)
GET_OPT_FUNCTION(AssociateDMPbufferSGIX, "glXAssociateDMPbufferSGIX");
#endif
-#ifdef GLX_SGIX_swap_group
+ /*** GLX_SGIX_swap_group ***/
GET_OPT_FUNCTION(JoinSwapGroupSGIX, "glXJoinSwapGroupSGIX");
-#endif
-#ifdef GLX_SGIX_swap_barrier
+ /*** GLX_SGIX_swap_barrier ***/
GET_OPT_FUNCTION(BindSwapBarrierSGIX, "glXBindSwapBarrierSGIX");
GET_OPT_FUNCTION(QueryMaxSwapBarriersSGIX, "glXQueryMaxSwapBarriersSGIX");
-#endif
-#ifdef GLX_SUN_get_transparent_index
+ /*** GLX_SUN_get_transparent_index ***/
GET_OPT_FUNCTION(GetTransparentIndexSUN, "glXGetTransparentIndexSUN");
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+ /*** GLX_MESA_copy_sub_buffer ***/
GET_OPT_FUNCTION(CopySubBufferMESA, "glXCopySubBufferMESA");
-#endif
-#ifdef GLX_MESA_release_buffers
+ /*** GLX_MESA_release_buffers ***/
GET_OPT_FUNCTION(ReleaseBuffersMESA, "glXReleaseBuffersMESA");
-#endif
-#ifdef GLX_MESA_pixmap_colormap
+ /*** GLX_MESA_pixmap_colormap ***/
GET_OPT_FUNCTION(CreateGLXPixmapMESA, "glXCreateGLXPixmapMESA");
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+ /*** GLX_MESA_set_3dfx_mode ***/
GET_OPT_FUNCTION(Set3DfxModeMESA, "glXSet3DfxModeMESA");
-#endif
return GL_TRUE;
}
};
static struct name_address_pair GLX_functions[] = {
+ /*** GLX_VERSION_1_0 ***/
{ "glXChooseVisual", (GLvoid *) glXChooseVisual },
{ "glXCopyContext", (GLvoid *) glXCopyContext },
{ "glXCreateContext", (GLvoid *) glXCreateContext },
{ "glXWaitGL", (GLvoid *) glXWaitGL },
{ "glXWaitX", (GLvoid *) glXWaitX },
-#ifdef GLX_VERSION_1_1
+ /*** GLX_VERSION_1_1 ***/
{ "glXGetClientString", (GLvoid *) glXGetClientString },
{ "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString },
{ "glXQueryServerString", (GLvoid *) glXQueryServerString },
-#endif
-#ifdef GLX_VERSION_1_2
+ /*** GLX_VERSION_1_2 ***/
{ "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },
-#endif
-#ifdef GLX_VERSION_1_3
+ /*** GLX_VERSION_1_3 ***/
{ "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig },
{ "glXCreateNewContext", (GLvoid *) glXCreateNewContext },
{ "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer },
{ "glXQueryContext", (GLvoid *) glXQueryContext },
{ "glXQueryDrawable", (GLvoid *) glXQueryDrawable },
{ "glXSelectEvent", (GLvoid *) glXSelectEvent },
-#endif
-#ifdef GLX_SGI_video_sync
+ /*** GLX_SGI_video_sync ***/
{ "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI },
{ "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI },
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+ /*** GLX_MESA_copy_sub_buffer ***/
{ "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA },
-#endif
-#ifdef GLX_MESA_release_buffers
+ /*** GLX_MESA_release_buffers ***/
{ "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA },
-#endif
-#ifdef GLX_MESA_pixmap_colormap
+ /*** GLX_MESA_pixmap_colormap ***/
{ "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA },
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+ /*** GLX_MESA_set_3dfx_mode ***/
{ "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA },
-#endif
+ /*** GLX_ARB_get_proc_address ***/
{ "glXGetProcAddressARB", (GLvoid *) glXGetProcAddressARB },
{ NULL, NULL } /* end of list */
-/* $Id: glxapi.h,v 1.9 2001/05/24 19:06:21 brianp Exp $ */
+/* $Id: glxapi.h,v 1.10 2001/05/25 21:51:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
* the DRI. Red Hat, however, has used it for their custom libGL.
*/
struct _glxapi_table {
- /* GLX 1.0 functions */
+ /*** GLX_VERSION_1_0 ***/
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);
void (*WaitGL)(void);
void (*WaitX)(void);
-#ifdef GLX_VERSION_1_1
+ /*** GLX_VERSION_1_1 ***/
const char *(*GetClientString)(Display *dpy, int name);
const char *(*QueryExtensionsString)(Display *dpy, int screen);
const char *(*QueryServerString)(Display *dpy, int screen, int name);
-#endif
-#ifdef GLX_VERSION_1_2
+ /*** GLX_VERSION_1_2 ***/
/*Display *(*GetCurrentDisplay)(void);*/
-#endif
-#ifdef GLX_VERSION_1_3
+ /*** GLX_VERSION_1_3 ***/
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);
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);
-#endif
-#ifdef GLX_SGI_swap_control
+ /*** GLX_SGI_swap_control ***/
int (*SwapIntervalSGI)(int);
-#endif
-#ifdef GLX_SGI_video_sync
+ /*** GLX_SGI_video_sync ***/
int (*GetVideoSyncSGI)(unsigned int *count);
int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
-#endif
-#ifdef GLX_SGI_make_current_read
+ /*** GLX_SGI_make_current_read ***/
Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
/*GLXDrawable (*GetCurrentReadDrawableSGI)(void);*/
-#endif
-#if defined(_VL_H) && defined(GLX_SGIX_video_source)
+ /*** GLX_SGIX_video_source (needs video library) ***/
+#if defined(_VL_H_)
GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
+#else
+ void *CreateGLXVideoSourceSGIX;
+ void *DestroyGLXVideoSourceSGIX;
#endif
-#ifdef GLX_EXT_import_context
+ /*** GLX_EXT_import_context ***/
void (*FreeContextEXT)(Display *dpy, GLXContext context);
GLXContextID (*GetContextIDEXT)(const GLXContext context);
/*Display *(*GetCurrentDisplayEXT)(void);*/
GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
-#endif
-#ifdef GLX_SGIX_fbconfig
+ /*** GLX_SGIX_fbconfig ***/
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 *);
-#endif
-#ifdef GLX_SGIX_pbuffer
+ /*** GLX_SGIX_pbuffer ***/
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 *);
-#endif
-#ifdef GLX_SGI_cushion
+ /*** GLX_SGI_cushion ***/
void (*CushionSGI)(Display *, Window, float);
-#endif
-#ifdef GLX_SGIX_video_resize
+ /*** GLX_SGIX_video_resize ***/
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);
-#endif
-#if defined (_DM_BUFFER_H_) && defined(GLX_SGIX_dmbuffer)
+ /*** GLX_SGIX_dmbuffer (needs dmedia library) ***/
+#if defined (_DM_BUFFER_H_)
Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#else
+ void *AssociciateDMPbufferSGIX;
#endif
-#ifdef GLX_SGIX_swap_group
+ /*** GLX_SGIX_swap_group ***/
void (*JoinSwapGroupSGIX)(Display *, GLXDrawable, GLXDrawable);
-#endif
-#ifdef GLX_SGIX_swap_barrier
+ /*** GLX_SGIX_swap_barrier ***/
void (*BindSwapBarrierSGIX)(Display *, GLXDrawable, int);
Bool (*QueryMaxSwapBarriersSGIX)(Display *, int, int *);
-#endif
-#ifdef GLX_SUN_get_transparent_index
+ /*** GLX_SUN_get_transparent_index ***/
Status (*GetTransparentIndexSUN)(Display *, Window, Window, long *);
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+ /*** GLX_MESA_copy_sub_buffer ***/
void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
-#endif
-#ifdef GLX_MESA_release_buffers
+ /*** GLX_MESA_release_buffers ***/
Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
-#endif
-#ifdef GLX_MESA_pixmap_colormap
+ /*** GLX_MESA_pixmap_colormap ***/
GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
+ /*** GLX_MESA_set_3dfx_mode ***/
Bool (*Set3DfxModeMESA)(int mode);
-#endif
};