{ GLX_VERSION_1_0
@v #define GLX_USE_GL            1
@v #define GLX_BUFFER_SIZE       2
@v #define GLX_LEVEL             3
@v #define GLX_RGBA              4
@v #define GLX_DOUBLEBUFFER      5
@v #define GLX_STEREO            6
@v #define GLX_AUX_BUFFERS       7
@v #define GLX_RED_SIZE          8
@v #define GLX_GREEN_SIZE        9
@v #define GLX_BLUE_SIZE        10
@v #define GLX_ALPHA_SIZE       11
@v #define GLX_DEPTH_SIZE       12
@v #define GLX_STENCIL_SIZE     13
@v #define GLX_ACCUM_RED_SIZE   14
@v #define GLX_ACCUM_GREEN_SIZE 15
@v #define GLX_ACCUM_BLUE_SIZE  16
@v #define GLX_ACCUM_ALPHA_SIZE 17
@v #define GLX_BAD_SCREEN        1
@v #define GLX_BAD_ATTRIBUTE     2
@v #define GLX_NO_EXTENSION      3
@v #define GLX_BAD_VISUAL        4
@v #define GLX_BAD_CONTEXT       5
@v #define GLX_BAD_VALUE         6
@v #define GLX_BAD_ENUM          7
@v typedef XID GLXDrawable;
@v typedef XID GLXPixmap;
@v typedef struct __GLXcontextRec* GLXContext;
@p Bool glXQueryExtension (Display*, int*, int*);
@p Bool glXQueryVersion (Display*, int*, int*);
@p int glXGetConfig (Display*, XVisualInfo*, int, int*);
@p XVisualInfo* glXChooseVisual (Display*, int, int*);
@p GLXPixmap glXCreateGLXPixmap (Display*, XVisualInfo*, Pixmap);
@p void glXDestroyGLXPixmap (Display*, GLXPixmap);
@p GLXContext glXCreateContext (Display*, XVisualInfo*, GLXContext, Bool);
@p void glXDestroyContext (Display*, GLXContext);
@p Bool glXIsDirect (Display*, GLXContext);
@p void glXCopyContext (Display*, GLXContext, GLXContext, GLuint);
@p Bool glXMakeCurrent (Display*, GLXDrawable, GLXContext);
@p GLXContext glXGetCurrentContext (void);
@p GLXDrawable glXGetCurrentDrawable (void);
@p void glXWaitGL (void);
@p void glXWaitX (void);
@p void glXSwapBuffers (Display*, GLXDrawable);
@p void glXUseXFont (Font, int, int, int);
}

{ GLX_VERSION_1_1
@v #define GLX_VENDOR     1
@v #define GLX_VERSION    2
@v #define GLX_EXTENSIONS 3
@p const char* glXQueryExtensionsString (Display*, int);
@p const char* glXGetClientString (Display*, int);
@p const char* glXQueryServerString (Display*, int, int);
}

{ GLX_VERSION_1_2
@f Display* glXGetCurrentDisplay (void);
}

{ GLX_VERSION_1_3
@v #define GLX_WINDOW_BIT                     0x00000001
@v #define GLX_PIXMAP_BIT                     0x00000002
@v #define GLX_PBUFFER_BIT                    0x00000004
@v #define GLX_RGBA_BIT                       0x00000001
@v #define GLX_COLOR_INDEX_BIT                0x00000002
@v #define GLX_PBUFFER_CLOBBER_MASK           0x08000000
@v #define GLX_FRONT_LEFT_BUFFER_BIT          0x00000001
@v #define GLX_FRONT_RIGHT_BUFFER_BIT         0x00000002
@v #define GLX_BACK_LEFT_BUFFER_BIT           0x00000004
@v #define GLX_BACK_RIGHT_BUFFER_BIT          0x00000008
@v #define GLX_AUX_BUFFERS_BIT                0x00000010
@v #define GLX_DEPTH_BUFFER_BIT               0x00000020
@v #define GLX_STENCIL_BUFFER_BIT             0x00000040
@v #define GLX_ACCUM_BUFFER_BIT               0x00000080
@v #define GLX_CONFIG_CAVEAT                  0x20
@v #define GLX_X_VISUAL_TYPE                  0x22
@v #define GLX_TRANSPARENT_TYPE               0x23
@v #define GLX_TRANSPARENT_INDEX_VALUE        0x24
@v #define GLX_TRANSPARENT_RED_VALUE          0x25
@v #define GLX_TRANSPARENT_GREEN_VALUE        0x26
@v #define GLX_TRANSPARENT_BLUE_VALUE         0x27
@v #define GLX_TRANSPARENT_ALPHA_VALUE        0x28
@v #define GLX_DONT_CARE                      0xFFFFFFFF
@v #define GLX_NONE                           0x8000
@v #define GLX_SLOW_CONFIG                    0x8001
@v #define GLX_TRUE_COLOR                     0x8002
@v #define GLX_DIRECT_COLOR                   0x8003
@v #define GLX_PSEUDO_COLOR                   0x8004
@v #define GLX_STATIC_COLOR                   0x8005
@v #define GLX_GRAY_SCALE                     0x8006
@v #define GLX_STATIC_GRAY                    0x8007
@v #define GLX_TRANSPARENT_RGB                0x8008
@v #define GLX_TRANSPARENT_INDEX              0x8009
@v #define GLX_VISUAL_ID                      0x800B
@v #define GLX_SCREEN                         0x800C
@v #define GLX_NON_CONFORMANT_CONFIG          0x800D
@v #define GLX_DRAWABLE_TYPE                  0x8010
@v #define GLX_RENDER_TYPE                    0x8011
@v #define GLX_X_RENDERABLE                   0x8012
@v #define GLX_FBCONFIG_ID                    0x8013
@v #define GLX_RGBA_TYPE                      0x8014
@v #define GLX_COLOR_INDEX_TYPE               0x8015
@v #define GLX_MAX_PBUFFER_WIDTH              0x8016
@v #define GLX_MAX_PBUFFER_HEIGHT             0x8017
@v #define GLX_MAX_PBUFFER_PIXELS             0x8018
@v #define GLX_PRESERVED_CONTENTS             0x801B
@v #define GLX_LARGEST_PBUFFER                0x801C
@v #define GLX_WIDTH                          0x801D
@v #define GLX_HEIGHT                         0x801E
@v #define GLX_EVENT_MASK                     0x801F
@v #define GLX_DAMAGED                        0x8020
@v #define GLX_SAVED                          0x8021
@v #define GLX_WINDOW                         0x8022
@v #define GLX_PBUFFER                        0x8023
@v #define GLX_PBUFFER_HEIGHT                 0x8040
@v #define GLX_PBUFFER_WIDTH                  0x8041
@v typedef struct __GLXFBConfigRec* GLXFBConfig;
@v typedef XID GLXWindow;
@v typedef XID GLXPbuffer;
@f GLXFBConfig* glXGetFBConfigs (Display*, int, int*);
@f GLXFBConfig* glXChooseFBConfig (Display*, int, const int*, int*);
@f int glXGetFBConfigAttrib (Display*, GLXFBConfig, int, int*);
@f XVisualInfo* glXGetVisualFromFBConfig (Display*, GLXFBConfig);
@f GLXWindow glXCreateWindow (Display*, GLXFBConfig, Window, const int*);
@f void glXDestroyWindow (Display*, GLXWindow);
@f GLXPixmap glXCreatePixmap (Display*, GLXFBConfig, Pixmap, const int*);
@f void glXDestroyPixmap (Display*, GLXPixmap);
@f GLXPbuffer glXCreatePbuffer (Display*, GLXFBConfig, const int*);
@f void glXDestroyPbuffer (Display*, GLXPbuffer);
@f void glXQueryDrawable (Display*, GLXDrawable, int, unsigned int*);
@f GLXContext glXCreateNewContext (Display*, GLXFBConfig, int, GLXContext, Bool);
@f Bool glXMakeContextCurrent (Display*, GLXDrawable, GLXDrawable, GLXContext);
@f GLXDrawable glXGetCurrentReadDrawable (void);
@f int glXQueryContext (Display*, GLXContext, int, int*);
@f void glXSelectEvent (Display*, GLXDrawable, unsigned long);
@f void glXGetSelectedEvent (Display*, GLXDrawable, unsigned long*);
}

{ GLX_VERSION_1_4
@v #define GLX_SAMPLE_BUFFERS                 100000
@v #define GLX_SAMPLES                        100001
@v extern void (*glXGetProcAddress (const GLubyte*))(void);
}

{ GLX_ARB_get_proc_address
@v extern void (*glXGetProcAddressARB (const GLubyte*))(void);
}

{ GLX_ARB_multisample
@v #define GLX_SAMPLE_BUFFERS_ARB             100000
@v #define GLX_SAMPLES_ARB                    100001
}

{ GLX_ARB_fbconfig_float
@v #define GLX_RGBA_FLOAT_TYPE_ARB            0x20B9
@v #define GLX_RGBA_FLOAT_BIT_ARB             0x00000004
}

{ GLX_SGIS_multisample
@v #define GLX_SAMPLE_BUFFERS_SGIS            100000
@v #define GLX_SAMPLES_SGIS                   100001
}

{ GLX_EXT_visual_info
@v #define GLX_X_VISUAL_TYPE_EXT              0x22
@v #define GLX_TRANSPARENT_TYPE_EXT           0x23
@v #define GLX_TRANSPARENT_INDEX_VALUE_EXT    0x24
@v #define GLX_TRANSPARENT_RED_VALUE_EXT      0x25
@v #define GLX_TRANSPARENT_GREEN_VALUE_EXT    0x26
@v #define GLX_TRANSPARENT_BLUE_VALUE_EXT     0x27
@v #define GLX_TRANSPARENT_ALPHA_VALUE_EXT    0x28
@v #define GLX_NONE_EXT                       0x8000
@v #define GLX_TRUE_COLOR_EXT                 0x8002
@v #define GLX_DIRECT_COLOR_EXT               0x8003
@v #define GLX_PSEUDO_COLOR_EXT               0x8004
@v #define GLX_STATIC_COLOR_EXT               0x8005
@v #define GLX_GRAY_SCALE_EXT                 0x8006
@v #define GLX_STATIC_GRAY_EXT                0x8007
@v #define GLX_TRANSPARENT_RGB_EXT            0x8008
@v #define GLX_TRANSPARENT_INDEX_EXT          0x8009
}

{ GLX_SGI_swap_control
@f int glXSwapIntervalSGI (int);
}

{ GLX_SGI_video_sync
@f int glXGetVideoSyncSGI (unsigned int*);
@f int glXWaitVideoSyncSGI (int, int, unsigned int*);
}

{ GLX_SGI_make_current_read
@f Bool glXGetCurrentReadDrawableSGI (Display*, GLXDrawable, GLXDrawable, GLXContext);
@f GLXDrawable glXMakeCurrentReadSGI (void);
}

{ GLX_EXT_visual_rating
@v #define GLX_VISUAL_CAVEAT_EXT              0x20
@v #define GLX_SLOW_VISUAL_EXT                0x8001
@v #define GLX_NON_CONFORMANT_VISUAL_EXT      0x800D
@v /* reuse GLX_NONE_EXT */
}

{ GLX_EXT_import_context
@v #define GLX_SHARE_CONTEXT_EXT              0x800A
@v #define GLX_VISUAL_ID_EXT                  0x800B
@v #define GLX_SCREEN_EXT                     0x800C
@v typedef XID GLXContextID;
@f Display* glXGetCurrentDisplayEXT (void);
@f int glXQueryContextInfoEXT (Display*, GLXContext, int, int*);
@f GLXContextID glXGetContextIDEXT (const GLXContext);
@f GLXContext glXImportContextEXT (Display*, GLXContextID);
@f void glXFreeContextEXT (Display*, GLXContext);
}

{ GLX_SGIX_fbconfig
@v #define GLX_WINDOW_BIT_SGIX                0x00000001
@v #define GLX_PIXMAP_BIT_SGIX                0x00000002
@v #define GLX_RGBA_BIT_SGIX                  0x00000001
@v #define GLX_COLOR_INDEX_BIT_SGIX           0x00000002
@v #define GLX_DRAWABLE_TYPE_SGIX             0x8010
@v #define GLX_RENDER_TYPE_SGIX               0x8011
@v #define GLX_X_RENDERABLE_SGIX              0x8012
@v #define GLX_FBCONFIG_ID_SGIX               0x8013
@v #define GLX_RGBA_TYPE_SGIX                 0x8014
@v #define GLX_COLOR_INDEX_TYPE_SGIX          0x8015
@v /* reuse GLX_SCREEN_EXT */
@v typedef XID GLXFBConfigIDSGIX;
@v typedef struct __GLXFBConfigRec* GLXFBConfigSGIX;
@f int glXGetFBConfigAttribSGIX (Display*, GLXFBConfigSGIX, int, int*);
@f GLXFBConfigSGIX* glXChooseFBConfigSGIX (Display*, int, int*, int*);
@f GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display*, GLXFBConfigSGIX, Pixmap);
@f GLXContext glXCreateContextWithConfigSGIX (Display*, GLXFBConfigSGIX, int, GLXContext, Bool);
@f XVisualInfo* glXGetVisualFromFBConfigSGIX (Display*, GLXFBConfigSGIX);
@f GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display*, XVisualInfo*);
}

{ GLX_SGIX_pbuffer
@v #define GLX_PBUFFER_BIT_SGIX               0x00000004
@v #define GLX_BUFFER_CLOBBER_MASK_SGIX       0x08000000
@v #define GLX_FRONT_LEFT_BUFFER_BIT_SGIX     0x00000001
@v #define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX    0x00000002
@v #define GLX_BACK_LEFT_BUFFER_BIT_SGIX      0x00000004
@v #define GLX_BACK_RIGHT_BUFFER_BIT_SGIX     0x00000008
@v #define GLX_AUX_BUFFERS_BIT_SGIX           0x00000010
@v #define GLX_DEPTH_BUFFER_BIT_SGIX          0x00000020
@v #define GLX_STENCIL_BUFFER_BIT_SGIX        0x00000040
@v #define GLX_ACCUM_BUFFER_BIT_SGIX          0x00000080
@v #define GLX_SAMPLE_BUFFERS_BIT_SGIX        0x00000100
@v #define GLX_MAX_PBUFFER_WIDTH_SGIX         0x8016
@v #define GLX_MAX_PBUFFER_HEIGHT_SGIX        0x8017
@v #define GLX_MAX_PBUFFER_PIXELS_SGIX        0x8018
@v #define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX     0x8019
@v #define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX    0x801A
@v #define GLX_PRESERVED_CONTENTS_SGIX        0x801B
@v #define GLX_LARGEST_PBUFFER_SGIX           0x801C
@v #define GLX_WIDTH_SGIX                     0x801D
@v #define GLX_HEIGHT_SGIX                    0x801E
@v #define GLX_EVENT_MASK_SGIX                0x801F
@v #define GLX_DAMAGED_SGIX                   0x8020
@v #define GLX_SAVED_SGIX                     0x8021
@v #define GLX_WINDOW_SGIX                    0x8022
@v #define GLX_PBUFFER_SGIX                   0x8023
@v typedef XID GLXPbufferSGIX;
@v typedef struct
@v {
@v     int type;
@v     unsigned long serial;   /* # of last request processed by server */
@v     Bool send_event;        /* true if this came for SendEvent request */
@v     Display *display;       /* display the event was read from */
@v     GLXDrawable drawable;   /* i.d. of Drawable */
@v     int event_type;         /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
@v     int draw_type;          /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
@v     unsigned int mask;      /* mask indicating which buffers are affected*/
@v     int x, y;
@v     int width, height;
@v     int count;              /* if nonzero, at least this many more */
@v }
@v GLXBufferClobberEventSGIX;
@f GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display*, GLXFBConfigSGIX, unsigned int, unsigned int, int*);
@f void glXDestroyGLXPbufferSGIX (Display*, GLXPbufferSGIX);
@f int glXQueryGLXPbufferSGIX (Display*, GLXPbufferSGIX, int, unsigned int*);
@f void glXSelectEventSGIX (Display*, GLXDrawable, unsigned long);
@f void glXGetSelectedEventSGIX (Display*, GLXDrawable, unsigned long*);
}

{ GLX_SGI_cushion
@f void glXCushionSGI (Display*, Window, float);
}

{ GLX_SGIX_video_resize
@v #define GLX_SYNC_FRAME_SGIX                0x00000000
@v #define GLX_SYNC_SWAP_SGIX                 0x00000001
@f int glXBindChannelToWindowSGIX (Display*, int, int, Window);
@f int glXChannelRectSGIX (Display*, int, int, int, int, int, int);
@f int glXQueryChannelRectSGIX (Display*, int, int, int*, int*, int*, int*);
@f int glXQueryChannelDeltasSGIX (Display*, int, int, int*, int*, int*, int*);
@f int glXChannelRectSyncSGIX (Display*, int, int, GLenum);
}

{ GLX_SGIX_dmbuffer
@v /*
@v The type DMparams and DMbuffer are not defined in glxext.h.  Once ported to
@v the SGI, I will expose this extension.
@v 
@v #define GLX_DIGITAL_MEDIA_PBUFFER_SGIX     0x8024
@v typedef Bool (*PFNGLXASSOCIATEDMPBUFFERSGIXPROC)(Display*, GLXPbufferSGIX, DMparams*, DMbuffer);
@v extern PFNGLXASSOCIATEDMPBUFFERSGIXPROC glXAssociatedMPbufferSGIX;
@v */
}

{ GLX_SGIX_swap_group
@f void glXJoinSwapGroupSGIX (Display*, GLXDrawable, GLXDrawable);
}

{ GLX_SGIX_swap_barrier
@f void glXBindSwapBarrierSGIX (Display*, GLXDrawable, int);
@f Bool glXQueryMaxSwapBarriersSGIX (Display*, int, int*);
}

{ GLX_SGIS_blended_overlay
@v #define GLX_BLENDED_RGBA_SGIS              0x8025
}

{ GLX_SGIS_shared_multisample
@v #define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
@v #define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
}

{ GLX_SUN_get_transparent_index
@f Status glXGetTransparentIndexSUN (Display*, Window, Window, long*);
}

{ GLX_3DFX_multisample
@v #define GLX_SAMPLE_BUFFERS_3DFX            0x8050
@v #define GLX_SAMPLES_3DFX                   0x8051
}

{ GLX_MESA_copy_sub_buffer
@f void glXCopySubBufferMESA (Display*, GLXDrawable, int, int, int, int);
}

{ GLX_MESA_pixmap_colormap
@f GLXPixmap glXCreateGLXPixmapMESA (Display*, XVisualInfo*, Pixmap, Colormap);
}

{ GLX_MESA_release_buffers
@f Bool glXReleaseBuffersMESA (Display*, GLXDrawable);
}

{ GLX_MESA_set_3dfx_mode
@v #define GLX_3DFX_WINDOW_MODE_MESA          0x1
@v #define GLX_3DFX_FULLSCREEN_MODE_MESA      0x2
@f Bool glXSet3DfxModeMESA (int);
}

{ GLX_SGIX_visual_select_group
@v #define GLX_VISUAL_SELECT_GROUP_SGIX       0x8028
}

{ GLX_OML_swap_method
@v #define GLX_SWAP_METHOD_OML                0x8060
@v #define GLX_SWAP_EXCHANGE_OML              0x8061
@v #define GLX_SWAP_COPY_OML                  0x8062
@v #define GLX_SWAP_UNDEFINED_OML             0x8063
}

{ GLX_OML_sync_control
@v #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
@v #include <inttypes.h>
@v #elif defined( __VMS )
@v #include <inttypes.h>
@v #elif defined(__SCO__) || defined(__USLC__)
@v #include <stdint.h>
@v #elif defined(__UNIXOS2__) || defined(__SOL64__)
@v typedef long int int32_t;
@v typedef long long int int64_t;
@v #else
@v typedef long long int int64_t;
@v #endif
@f Bool glXGetSyncValuesOML (Display*, GLXDrawable, int64_t*, int64_t*, int64_t*);
@f Bool glXGetMscRateOML (Display*, GLXDrawable, int32_t*, int32_t*);
@f int64_t glXSwapBuffersMscOML (Display*, GLXDrawable, int64_t, int64_t, int64_t);
@f Bool glXWaitForMscOML (Display*, GLXDrawable, int64_t, int64_t, int64_t, int64_t*, int64_t*, int64_t*);
@f Bool glXWaitForSbcOML (Display*, GLXDrawable, int64_t, int64_t*, int64_t*, int64_t*);
}

{ GLX_NV_float_buffer
@v #define GLX_FLOAT_COMPONENTS_NV            0x20B0
}

{ GLX_SGIX_hyperpipe
@v #define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
@v #define GLX_BAD_HYPERPIPE_CONFIG_SGIX      91
@v #define GLX_BAD_HYPERPIPE_SGIX             92
@v #define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX    0x00000001
@v #define GLX_HYPERPIPE_RENDER_PIPE_SGIX     0x00000002
@v #define GLX_PIPE_RECT_SGIX                 0x00000001
@v #define GLX_PIPE_RECT_LIMITS_SGIX          0x00000002
@v #define GLX_HYPERPIPE_STEREO_SGIX          0x00000003
@v #define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX   0x00000004
@v #define GLX_HYPERPIPE_ID_SGIX              0x8030
@v typedef struct
@v {
@v     char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
@v     int  networkId;
@v }
@v GLXHyperpipeNetworkSGIX;
@v typedef struct
@v {
@v     char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
@v     int channel;
@v     unsigned int participationType;
@v     int timeSlice;
@v }
@v GLXHyperpipeConfigSGIX;
@v typedef struct
@v {
@v     char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
@v     int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
@v     int destXOrigin, destYOrigin, destWidth, destHeight;
@v }
@v GLXPipeRect;
@v typedef struct
@v {
@v     char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
@v     int XOrigin, YOrigin, maxHeight, maxWidth;
@v }
@v GLXPipeRectLimits;
@f GLXHyperpipeNetworkSGIX* glXQueryHyperpipeNetworkSGIX (Display*, int*);
@f int glXHyperpipeConfigSGIX (Display*, int, int, GLXHyperpipeConfigSGIX*, int*);
@f GLXHyperpipeConfigSGIX* glXQueryHyperpipeConfigSGIX (Display*, int, int*);
@f int glXDestroyHyperpipeConfigSGIX (Display*, int);
@f int glXBindHyperpipeSGIX (Display*, int);
@f int glXQueryHyperpipeBestAttribSGIX (Display*, int, int, int, void*, void*);
@f int glXHyperpipeAttribSGIX (Display*, int, int, int, void*);
@f int glXQueryHyperpipeAttribSGIX (Display*, int, int, int, void*);
}

{ GLX_MESA_agp_offset
@f unsigned int glXGetAGPOffsetMesa (const void*);
}
