added do /while to multi-line macros
[mesa.git] / include / GL / glx.h
index 9d4c2023f8e1f6de24c31bac9f6916eee773b7db..b9c494697eaa3efa7da4406ecadc0265cef46f65 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: glx.h,v 1.6 1999/11/11 01:27:17 brianp Exp $ */
+/* $Id: glx.h,v 1.10 1999/12/11 09:54:33 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -49,6 +49,8 @@ extern "C" {
 
 
 #define GLX_VERSION_1_1                1
+#define GLX_VERSION_1_2                1
+#define GLX_VERSION_1_3                1
 
 #define GLX_EXTENSION_NAME   "GLX"
 
@@ -76,17 +78,6 @@ extern "C" {
 #define GLX_ACCUM_ALPHA_SIZE   17
 
 
-/* GLX_EXT_visual_info extension */
-#define GLX_X_VISUAL_TYPE_EXT          0x22
-#define GLX_TRANSPARENT_TYPE_EXT       0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT        0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT  0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT        0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT        0x28
-
-
-
 /*
  * Error codes returned by glXGetConfig:
  */
@@ -107,6 +98,75 @@ extern "C" {
 #define GLX_EXTENSIONS                 3
 
 
+/*
+ * GLX 1.3 and later:
+ * XXX don't know the values of some of these enums!
+ * XXX some 1.3 enums may be missing!
+ */
+#define GLX_CONFIG_CAVEAT              ?
+#define GLX_DONT_CARE                  ?
+#define GLX_SLOW_CONFIG                        ?
+#define GLX_NON_CONFORMANT_CONFIG      ?
+#define GLX_X_VISUAL_TYPE              0x22
+#define GLX_TRANSPARENT_TYPE           0x23
+#define GLX_TRANSPARENT_INDEX_VALUE    0x24
+#define GLX_TRANSPARENT_RED_VALUE      0x25
+#define GLX_TRANSPARENT_GREEN_VALUE    0x26
+#define GLX_TRANSPARENT_BLUE_VALUE     0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE    0x28
+#define GLX_MAX_PBUFFER_WIDTH          ?
+#define GLX_MAX_PBUFFER_HEIGHT         ?
+#define GLX_MAX_PBUFFER_PIXELS         ?
+#define GLX_PRESERVED_CONTENTS         ?
+#define GLX_LARGEST_BUFFER             ?
+#define GLX_DRAWABLE_TYPE              ?
+#define GLX_FBCONFIG_ID                        ?
+#define GLX_VISUAL_ID                  ?
+#define GLX_WINDOW_BIT                 ?
+#define GLX_PIXMAP_BIT                 ?
+#define GLX_PBUFFER_BIT                        ?
+#define GLX_AUX_BUFFERS_BIT            ?
+#define GLX_FRONT_LEFT_BUFFER_BIT      ?
+#define GLX_FRONT_RIGHT_BUFFER_BIT     ?
+#define GLX_BACK_LEFT_BUFFER_BIT       ?
+#define GLX_BACK_RIGHT_BUFFER_BIT      ?
+#define GLX_AUX_BUFFERS_BIT            ?
+#define GLX_DEPTH_BUFFER_BIT           ?
+#define GLX_STENCIL_BUFFER_BIT         ?
+#define GLX_ACCUM_BUFFER_BIT           ?
+#define GLX_RENDER_TYPE                        ?
+#define GLX_DRAWABLE_TYPE              ?
+#define GLX_X_RENDERABLE               ?
+#define GLX_NONE                       0x8000
+#define GLX_TRUE_COLOR                 0x8002
+#define GLX_DIRECT_COLOR               0x8003
+#define GLX_PSEUDO_COLOR               0x8004
+#define GLX_STATIC_COLOR               0x8005
+#define GLX_GRAY_SCALE                 0x8006
+#define GLX_STATIC_GRAY                        0x8007
+#define GLX_TRANSPARENT_INDEX          0x8009
+#define GLX_COLOR_INDEX_TYPE           ?
+#define GLX_COLOR_INDEX_BIT            ?
+#define GLX_SCREEN                     ?
+#define GLX_PBUFFER_CLOBBER_MASK       ?
+#define GLX_DAMAGED                    ?
+#define GLX_SAVED                      ?
+#define GLX_WINDOW                     ?
+#define GLX_PBUFFER                    ?
+
+
+/*
+ * GLX_EXT_visual_info extension
+ */
+#define GLX_X_VISUAL_TYPE_EXT          0x22
+#define GLX_TRANSPARENT_TYPE_EXT       0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT        0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT  0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT        0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT        0x28
+
+
 /*
  * GLX_visual_info extension
  */
@@ -125,12 +185,12 @@ extern "C" {
  * Compile-time extension tests
  */
 #define GLX_EXT_visual_info            1
-#define GLX_EXT_get_proc_address       1
 #define GLX_MESA_pixmap_colormap       1
 #define GLX_MESA_release_buffers       1
 #define GLX_MESA_copy_sub_buffer       1
 #define GLX_MESA_set_3dfx_mode         1
 #define GLX_SGI_video_sync             1
+#define GLX_ARB_get_proc_address       1
 
 
 
@@ -142,6 +202,12 @@ extern "C" {
    typedef void * GLXContext;
    typedef XID GLXPixmap;
    typedef XID GLXDrawable;
+   /* GLX 1.3 and later */
+   typedef XID GLXFBConfigID;
+   typedef XID GLXPfuffer;
+   typedef XID GLXWindow;
+   typedef XID GLXPbuffer;
+   typedef XID GLXFBConfig;
 #endif
 typedef XID GLXContextID;
 
@@ -197,6 +263,57 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name );
 extern const char *glXGetClientString( Display *dpy, int name );
 
 
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig glXChooseFBConfig( Display *dpy, int screen,
+                                      const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+                                 int attribute, int *value );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+                                              GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+                                  Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+                                  Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+                                    const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+                              unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+                                       int renderType, GLXContext shareList,
+                                       Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+                                   GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+                            int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+                            unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+                                 unsigned long *mask );
+
+
 
 /* GLX_MESA_pixmap_colormap */
 extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
@@ -222,6 +339,10 @@ extern int glXWaitVideoSyncSGI(int divisor, int remainder,
                                unsigned int *count);
 
 
+/* GLX_ARB_get_proc_address */
+extern void (*glXGetProcAddressARB(const GLubyte *procName))();
+
+
 
 #ifdef __cplusplus
 }