GL: drop symbols mangling support
[mesa.git] / src / mesa / drivers / x11 / glxapi.h
index b669cfc08bd3620ed4c61150ff2bc2d17bfc33fe..6a1ce66a8917f93ef586274506de0e8bf9609071 100644 (file)
@@ -1,10 +1,7 @@
-/* $Id: glxapi.h,v 1.5 2000/04/10 21:13:19 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.3
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  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"),
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
 #define _glxapi_h_
 
 
+#define GLX_GLXEXT_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
+/* The GLX API dispatcher (i.e. this code) is being built into stand-alone
+ * Mesa.  We don't know anything about XFree86 or real GLX so we define a
+ * minimal __GLXContextRec here so some of the functions in this file can
+ * work properly.
+ */
+typedef struct __GLXcontextRec {
+   GLboolean isDirect;
+   GLXDrawable currentDrawable;
+   GLXDrawable currentReadable;
+   XID xid;
+} __GLXcontext;
 
 
 /*
  * Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
  * pseudo-GLX can be present at the same time.  The former being used on
  * GLX-enabled X servers and the later on non-GLX X servers.
+ *
+ * Red Hat has been using this since Red Hat Linux 7.0 (I think).
+ * This'll be a standard feature in XFree86 4.3.  It basically allows one
+ * libGL to do both DRI-rendering and "fake GLX" rendering to X displays
+ * that lack the GLX extension.
  */
 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);
@@ -62,7 +67,7 @@ struct _glxapi_table {
    void (*DestroyContext)(Display *dpy, GLXContext ctx);
    void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
    int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
-   /*GLXContext (*GetCurrentContext)(void);*/
+   GLXContext (*GetCurrentContext)(void);
    /*GLXDrawable (*GetCurrentDrawable)(void);*/
    Bool (*IsDirect)(Display *dpy, GLXContext ctx);
    Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
@@ -73,17 +78,15 @@ struct _glxapi_table {
    void (*WaitGL)(void);
    void (*WaitX)(void);
 
-#ifdef _GLXAPI_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 _GLXAPI_VERSION_1_2
+   /*** GLX_VERSION_1_2 ***/
    /*Display *(*GetCurrentDisplay)(void);*/
-#endif
 
-#ifdef _GLXAPI_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);
@@ -101,41 +104,87 @@ struct _glxapi_table {
    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);
+
+   /*** GLX_SGI_swap_control ***/
+   int (*SwapIntervalSGI)(int);
+
+   /*** GLX_SGI_video_sync ***/
+   int (*GetVideoSyncSGI)(unsigned int *count);
+   int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
+
+   /*** GLX_SGI_make_current_read ***/
+   Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
+   /*GLXDrawable (*GetCurrentReadDrawableSGI)(void);*/
+
+   /*** 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 _GLXAPI_EXT_import_context
+   /*** GLX_EXT_import_context ***/
    void (*FreeContextEXT)(Display *dpy, GLXContext context);
    GLXContextID (*GetContextIDEXT)(const GLXContext context);
-   Display *(*GetCurrentDisplayEXT)(void);
+   /*Display *(*GetCurrentDisplayEXT)(void);*/
    GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
    int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
-#endif
 
-#ifdef _GLXAPI_SGI_video_sync
-   int (*GetVideoSyncSGI)(unsigned int *count);
-   int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
+   /*** 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 *);
+
+   /*** GLX_SGIX_pbuffer ***/
+   GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+   void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
+   void (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
+   void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
+   void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
+
+   /*** GLX_SGI_cushion ***/
+   void (*CushionSGI)(Display *, Window, float);
+
+   /*** 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);
+
+   /*** GLX_SGIX_dmbuffer (needs dmedia library) ***/
+#if defined (_DM_BUFFER_H_)
+   Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#else
+   void *AssociciateDMPbufferSGIX;
 #endif
 
-   /*
-    * XXX thesa Mesa-specific functions might not belong here
-    */
+   /*** GLX_SUN_get_transparent_index ***/
+   Status (*GetTransparentIndexSUN)(Display *, Window, Window, unsigned long *);
 
-#ifdef _GLXAPI_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 _GLXAPI_MESA_release_buffers
+   /*** GLX_MESA_release_buffers ***/
    Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
-#endif
 
-#ifdef _GLXAPI_MESA_pixmap_colormap
+   /*** GLX_MESA_pixmap_colormap ***/
    GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
-#endif
 
-#ifdef _GLXAPI_MESA_set_3dfx_mode
-   GLboolean (*Set3DfxModeMESA)(GLint mode);
-#endif
+   /*** GLX_EXT_texture_from_pixmap ***/
+   void (*BindTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer,
+                           const int *attrib_list);
+   void (*ReleaseTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer);
 
+   /*** GLX_ARB_create_context ***/
+   GLXContext (*CreateContextAttribs)(Display *dpy, GLXFBConfig config,
+                                      GLXContext share_context, Bool direct,
+                                      const int *attrib_list);
 };
 
 
@@ -156,7 +205,7 @@ extern void
 _glxapi_set_no_op_table(struct _glxapi_table *t);
 
 
-extern const GLvoid *
+extern __GLXextFuncPtr
 _glxapi_get_proc_address(const char *funcName);