-/* $Id: fakeglx.c,v 1.33 2000/04/19 01:44:01 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.34 2000/06/08 22:50:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
if (!drawBuffer) {
/* drawable must be a new window! */
- drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, ctx );
+ drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, (XMesaContext) ctx );
if (!drawBuffer) {
/* Out of memory, or context/drawable depth mismatch */
return False;
}
if (!readBuffer) {
/* drawable must be a new window! */
- readBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, read, ctx );
+ readBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, read, (XMesaContext) ctx );
if (!readBuffer) {
/* Out of memory, or context/drawable depth mismatch */
return False;
#ifdef GLX_MESA_pixmap_colormap
-
static GLXPixmap
Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo,
Pixmap pixmap, Colormap cmap )
}
return b->frontbuffer;
}
-
#endif
}
+
static void
Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
unsigned long mask )
}
+
+#ifdef 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_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
-/*
- * GLX_MESA_set_3dfx_mode
- */
+
+#ifdef GLX_MESA_set_3dfx_mode
static GLboolean
Fake_glXSet3DfxModeMESA( GLint mode )
{
return XMesaSetFXmode( mode );
}
+#endif
+
/*
glx.WaitGL = Fake_glXWaitGL;
glx.WaitX = Fake_glXWaitX;
-#ifdef _GLXAPI_VERSION_1_1
+#ifdef GLX_VERSION_1_1
glx.GetClientString = Fake_glXGetClientString;
glx.QueryExtensionsString = Fake_glXQueryExtensionsString;
glx.QueryServerString = Fake_glXQueryServerString;
#endif
-#ifdef _GLXAPI_VERSION_1_2
+#ifdef GLX_VERSION_1_2
/*glx.GetCurrentDisplay = Fake_glXGetCurrentDisplay;*/
#endif
-#ifdef _GLXAPI_VERSION_1_3
+#ifdef GLX_VERSION_1_3
glx.ChooseFBConfig = Fake_glXChooseFBConfig;
glx.CreateNewContext = Fake_glXCreateNewContext;
glx.CreatePbuffer = Fake_glXCreatePbuffer;
glx.SelectEvent = Fake_glXSelectEvent;
#endif
-#ifdef _GLXAPI_SGI_video_sync
+#ifdef GLX_SGI_video_sync
glx.GetVideoSyncSGI = Fake_glXGetVideoSyncSGI;
glx.WaitVideoSyncSGI = Fake_glXWaitVideoSyncSGI;
#endif
-#ifdef _GLXAPI_MESA_copy_sub_buffer
+#ifdef GLX_MESA_copy_sub_buffer
glx.CopySubBufferMESA = Fake_glXCopySubBufferMESA;
#endif
-#ifdef _GLXAPI_MESA_release_buffers
+#ifdef GLX_MESA_release_buffers
glx.ReleaseBuffersMESA = Fake_glXReleaseBuffersMESA;
#endif
-#ifdef _GLXAPI_MESA_pixmap_colormap
+#ifdef GLX_MESA_pixmap_colormap
glx.CreateGLXPixmapMESA = Fake_glXCreateGLXPixmapMESA;
#endif
-#ifdef _GLXAPI_MESA_set_3dfx_mode
+#ifdef GLX_MESA_set_3dfx_mode
glx.Set3DfxModeMESA = Fake_glXSet3DfxModeMESA;
#endif
-/* $Id: glxapi.c,v 1.16 2000/04/10 21:13:19 brianp Exp $ */
+/* $Id: glxapi.c,v 1.17 2000/06/08 22:50:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
-#ifdef _GLXAPI_VERSION_1_1
+#ifdef GLX_VERSION_1_1
const char *glXGetClientString(Display *dpy, int name)
{
-#ifdef _GLXAPI_VERSION_1_2
+#ifdef GLX_VERSION_1_2
Display *glXGetCurrentDisplay(void)
{
return CurrentDisplay;
-#ifdef _GLXAPI_VERSION_1_3
+#ifdef GLX_VERSION_1_3
GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems)
{
(t->SelectEvent)(dpy, drawable, mask);
}
-#endif /* _GLXAPI_VERSION_1_3 */
+#endif /* GLX_VERSION_1_3 */
-#ifdef _GLXAPI_EXT_import_context
+#ifdef GLX_EXT_import_context
void glXFreeContextEXT(Display *dpy, GLXContext context)
{
#endif
-#ifdef _GLXAPI_SGI_video_sync
+#ifdef GLX_SGI_video_sync
int glXGetVideoSyncSGI(unsigned int *count)
{
#endif
-#ifdef _GLXAPI_MESA_copy_sub_buffer
+#ifdef GLX_MESA_copy_sub_buffer
void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height)
{
#endif
-#ifdef _GLXAPI_MESA_release_buffers
+#ifdef GLX_MESA_release_buffers
Bool glXReleaseBuffersMESA(Display *dpy, Window w)
{
#endif
-#ifdef _GLXAPI_MESA_pixmap_colormap
+#ifdef GLX_MESA_pixmap_colormap
GLXPixmap glXCreateGLXPixmapMESA(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap)
{
#endif
-#ifdef _GLXAPI_MESA_set_3dfx_mode
+#ifdef GLX_MESA_set_3dfx_mode
GLboolean glXSet3DfxModeMESA(GLint mode)
{
_glxapi_get_extensions(void)
{
static const char *extensions[] = {
-#ifdef _GLXAPI_EXT_import_context
+#ifdef GLX_EXT_import_context
"GLX_EXT_import_context",
#endif
-#ifdef _GLXAPI_SGI_video_sync
+#ifdef GLX_SGI_video_sync
"GLX_SGI_video_sync",
#endif
-#ifdef _GLXAPI_MESA_copy_sub_buffer
+#ifdef GLX_MESA_copy_sub_buffer
"GLX_MESA_copy_sub_buffer",
#endif
-#ifdef _GLXAPI_MESA_release_buffers
+#ifdef GLX_MESA_release_buffers
"GLX_MESA_release_buffers",
#endif
-#ifdef _GLXAPI_MESA_pixmap_colormap
+#ifdef GLX_MESA_pixmap_colormap
"GLX_MESA_pixmap_colormap",
#endif
-#ifdef _GLXAPI_MESA_set_3dfx_mode
+#ifdef GLX_MESA_set_3dfx_mode
"GLX_MESA_set_3dfx_mode",
#endif
NULL
{ "glXWaitGL", (GLvoid *) glXWaitGL },
{ "glXWaitX", (GLvoid *) glXWaitX },
-#ifdef _GLXAPI_VERSION_1_1
+#ifdef GLX_VERSION_1_1
{ "glXGetClientString", (GLvoid *) glXGetClientString },
{ "glXQueryExtensionsString", (GLvoid *) glXQueryExtensionsString },
{ "glXQueryServerString", (GLvoid *) glXQueryServerString },
#endif
-#ifdef _GLXAPI_VERSION_1_2
+#ifdef GLX_VERSION_1_2
{ "glXGetCurrentDisplay", (GLvoid *) glXGetCurrentDisplay },
#endif
-#ifdef _GLXAPI_VERSION_1_3
+#ifdef GLX_VERSION_1_3
{ "glXChooseFBConfig", (GLvoid *) glXChooseFBConfig },
{ "glXCreateNewContext", (GLvoid *) glXCreateNewContext },
{ "glXCreatePbuffer", (GLvoid *) glXCreatePbuffer },
{ "glXSelectEvent", (GLvoid *) glXSelectEvent },
#endif
-#ifdef _GLXAPI_SGI_video_sync
+#ifdef GLX_SGI_video_sync
{ "glXGetVideoSyncSGI", (GLvoid *) glXGetVideoSyncSGI },
{ "glXWaitVideoSyncSGI", (GLvoid *) glXWaitVideoSyncSGI },
#endif
-#ifdef _GLXAPI_MESA_copy_sub_buffer
+#ifdef GLX_MESA_copy_sub_buffer
{ "glXCopySubBufferMESA", (GLvoid *) glXCopySubBufferMESA },
#endif
-#ifdef _GLXAPI_MESA_release_buffers
+#ifdef GLX_MESA_release_buffers
{ "glXReleaseBuffersMESA", (GLvoid *) glXReleaseBuffersMESA },
#endif
-#ifdef _GLXAPI_MESA_pixmap_colormap
+#ifdef GLX_MESA_pixmap_colormap
{ "glXCreateGLXPixmapMESA", (GLvoid *) glXCreateGLXPixmapMESA },
#endif
-#ifdef _GLXAPI_MESA_set_3dfx_mode
+#ifdef GLX_MESA_set_3dfx_mode
{ "glXSet3DfxModeMESA", (GLvoid *) glXSet3DfxModeMESA },
#endif
-/* $Id: glxapi.h,v 1.5 2000/04/10 21:13:19 brianp Exp $ */
+/* $Id: glxapi.h,v 1.6 2000/06/08 22:50:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define _glxapi_h_
+#define GLX_GLXEXT_LEGACY
+#define GL_GLEXT_PROTOTYPES
#include "GL/glx.h"
-#define _GLXAPI_VERSION_1_1 1
-#define _GLXAPI_VERSION_1_2 1
-#define _GLXAPI_VERSION_1_3 1
-
-#define _GLXAPI_EXT_import_context 1
-#define _GLXAPI_SGI_video_sync 1
-#define _GLXAPI_MESA_copy_sub_buffer 1
-#define _GLXAPI_MESA_release_buffers 1
-#define _GLXAPI_MESA_pixmap_colormap 1
-#define _GLXAPI_MESA_set_3dfx_mode 1
-
-
/*
* Almost all the GLX API functions get routed through this dispatch table.
* The exceptions are the glXGetCurrentXXX() functions.
void (*WaitGL)(void);
void (*WaitX)(void);
-#ifdef _GLXAPI_VERSION_1_1
+#ifdef 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 _GLXAPI_VERSION_1_2
+#ifdef GLX_VERSION_1_2
/*Display *(*GetCurrentDisplay)(void);*/
#endif
-#ifdef _GLXAPI_VERSION_1_3
+#ifdef 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);
void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
#endif
-#ifdef _GLXAPI_EXT_import_context
+#ifdef GLX_EXT_import_context
void (*FreeContextEXT)(Display *dpy, GLXContext context);
GLXContextID (*GetContextIDEXT)(const GLXContext context);
Display *(*GetCurrentDisplayEXT)(void);
int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
#endif
-#ifdef _GLXAPI_SGI_video_sync
+#ifdef GLX_SGI_video_sync
int (*GetVideoSyncSGI)(unsigned int *count);
int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
#endif
* XXX thesa Mesa-specific functions might not belong here
*/
-#ifdef _GLXAPI_MESA_copy_sub_buffer
+#ifdef GLX_MESA_copy_sub_buffer
void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
#endif
-#ifdef _GLXAPI_MESA_release_buffers
+#ifdef GLX_MESA_release_buffers
Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
#endif
-#ifdef _GLXAPI_MESA_pixmap_colormap
+#ifdef GLX_MESA_pixmap_colormap
GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
#endif
-#ifdef _GLXAPI_MESA_set_3dfx_mode
+#ifdef GLX_MESA_set_3dfx_mode
GLboolean (*Set3DfxModeMESA)(GLint mode);
#endif