17117f1b4Smrg/* 27117f1b4Smrg * Mesa 3-D graphics library 37117f1b4Smrg * 47117f1b4Smrg * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 57117f1b4Smrg * 67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a 77117f1b4Smrg * copy of this software and associated documentation files (the "Software"), 87117f1b4Smrg * to deal in the Software without restriction, including without limitation 97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the 117117f1b4Smrg * Software is furnished to do so, subject to the following conditions: 127117f1b4Smrg * 137117f1b4Smrg * The above copyright notice and this permission notice shall be included 147117f1b4Smrg * in all copies or substantial portions of the Software. 157117f1b4Smrg * 167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 187117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 237117f1b4Smrg */ 247117f1b4Smrg 257117f1b4Smrg 267117f1b4Smrg#ifndef GLX_H 277117f1b4Smrg#define GLX_H 287117f1b4Smrg 297117f1b4Smrg 307117f1b4Smrg#include <X11/Xlib.h> 317117f1b4Smrg#include <X11/Xutil.h> 327117f1b4Smrg#include <GL/gl.h> 337117f1b4Smrg 347117f1b4Smrg 357117f1b4Smrg#ifdef __cplusplus 367117f1b4Smrgextern "C" { 377117f1b4Smrg#endif 387117f1b4Smrg 397117f1b4Smrg 407117f1b4Smrg#define GLX_VERSION_1_1 1 417117f1b4Smrg#define GLX_VERSION_1_2 1 427117f1b4Smrg#define GLX_VERSION_1_3 1 437117f1b4Smrg#define GLX_VERSION_1_4 1 447117f1b4Smrg 457117f1b4Smrg#define GLX_EXTENSION_NAME "GLX" 467117f1b4Smrg 477117f1b4Smrg 487117f1b4Smrg 497117f1b4Smrg/* 507117f1b4Smrg * Tokens for glXChooseVisual and glXGetConfig: 517117f1b4Smrg */ 527117f1b4Smrg#define GLX_USE_GL 1 537117f1b4Smrg#define GLX_BUFFER_SIZE 2 547117f1b4Smrg#define GLX_LEVEL 3 557117f1b4Smrg#define GLX_RGBA 4 567117f1b4Smrg#define GLX_DOUBLEBUFFER 5 577117f1b4Smrg#define GLX_STEREO 6 587117f1b4Smrg#define GLX_AUX_BUFFERS 7 597117f1b4Smrg#define GLX_RED_SIZE 8 607117f1b4Smrg#define GLX_GREEN_SIZE 9 617117f1b4Smrg#define GLX_BLUE_SIZE 10 627117f1b4Smrg#define GLX_ALPHA_SIZE 11 637117f1b4Smrg#define GLX_DEPTH_SIZE 12 647117f1b4Smrg#define GLX_STENCIL_SIZE 13 657117f1b4Smrg#define GLX_ACCUM_RED_SIZE 14 667117f1b4Smrg#define GLX_ACCUM_GREEN_SIZE 15 677117f1b4Smrg#define GLX_ACCUM_BLUE_SIZE 16 687117f1b4Smrg#define GLX_ACCUM_ALPHA_SIZE 17 697117f1b4Smrg 707117f1b4Smrg 717117f1b4Smrg/* 727117f1b4Smrg * Error codes returned by glXGetConfig: 737117f1b4Smrg */ 747117f1b4Smrg#define GLX_BAD_SCREEN 1 757117f1b4Smrg#define GLX_BAD_ATTRIBUTE 2 767117f1b4Smrg#define GLX_NO_EXTENSION 3 777117f1b4Smrg#define GLX_BAD_VISUAL 4 787117f1b4Smrg#define GLX_BAD_CONTEXT 5 797117f1b4Smrg#define GLX_BAD_VALUE 6 807117f1b4Smrg#define GLX_BAD_ENUM 7 817117f1b4Smrg 827117f1b4Smrg 837117f1b4Smrg/* 847117f1b4Smrg * GLX 1.1 and later: 857117f1b4Smrg */ 867117f1b4Smrg#define GLX_VENDOR 1 877117f1b4Smrg#define GLX_VERSION 2 887117f1b4Smrg#define GLX_EXTENSIONS 3 897117f1b4Smrg 907117f1b4Smrg 917117f1b4Smrg/* 927117f1b4Smrg * GLX 1.3 and later: 937117f1b4Smrg */ 947117f1b4Smrg#define GLX_CONFIG_CAVEAT 0x20 957117f1b4Smrg#define GLX_DONT_CARE 0xFFFFFFFF 967117f1b4Smrg#define GLX_X_VISUAL_TYPE 0x22 977117f1b4Smrg#define GLX_TRANSPARENT_TYPE 0x23 987117f1b4Smrg#define GLX_TRANSPARENT_INDEX_VALUE 0x24 997117f1b4Smrg#define GLX_TRANSPARENT_RED_VALUE 0x25 1007117f1b4Smrg#define GLX_TRANSPARENT_GREEN_VALUE 0x26 1017117f1b4Smrg#define GLX_TRANSPARENT_BLUE_VALUE 0x27 1027117f1b4Smrg#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 1037117f1b4Smrg#define GLX_WINDOW_BIT 0x00000001 1047117f1b4Smrg#define GLX_PIXMAP_BIT 0x00000002 1057117f1b4Smrg#define GLX_PBUFFER_BIT 0x00000004 1067117f1b4Smrg#define GLX_AUX_BUFFERS_BIT 0x00000010 1077117f1b4Smrg#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 1087117f1b4Smrg#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 1097117f1b4Smrg#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 1107117f1b4Smrg#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 1117117f1b4Smrg#define GLX_DEPTH_BUFFER_BIT 0x00000020 1127117f1b4Smrg#define GLX_STENCIL_BUFFER_BIT 0x00000040 1137117f1b4Smrg#define GLX_ACCUM_BUFFER_BIT 0x00000080 1147117f1b4Smrg#define GLX_NONE 0x8000 1157117f1b4Smrg#define GLX_SLOW_CONFIG 0x8001 1167117f1b4Smrg#define GLX_TRUE_COLOR 0x8002 1177117f1b4Smrg#define GLX_DIRECT_COLOR 0x8003 1187117f1b4Smrg#define GLX_PSEUDO_COLOR 0x8004 1197117f1b4Smrg#define GLX_STATIC_COLOR 0x8005 1207117f1b4Smrg#define GLX_GRAY_SCALE 0x8006 1217117f1b4Smrg#define GLX_STATIC_GRAY 0x8007 1227117f1b4Smrg#define GLX_TRANSPARENT_RGB 0x8008 1237117f1b4Smrg#define GLX_TRANSPARENT_INDEX 0x8009 1247117f1b4Smrg#define GLX_VISUAL_ID 0x800B 1257117f1b4Smrg#define GLX_SCREEN 0x800C 1267117f1b4Smrg#define GLX_NON_CONFORMANT_CONFIG 0x800D 1277117f1b4Smrg#define GLX_DRAWABLE_TYPE 0x8010 1287117f1b4Smrg#define GLX_RENDER_TYPE 0x8011 1297117f1b4Smrg#define GLX_X_RENDERABLE 0x8012 1307117f1b4Smrg#define GLX_FBCONFIG_ID 0x8013 1317117f1b4Smrg#define GLX_RGBA_TYPE 0x8014 1327117f1b4Smrg#define GLX_COLOR_INDEX_TYPE 0x8015 1337117f1b4Smrg#define GLX_MAX_PBUFFER_WIDTH 0x8016 1347117f1b4Smrg#define GLX_MAX_PBUFFER_HEIGHT 0x8017 1357117f1b4Smrg#define GLX_MAX_PBUFFER_PIXELS 0x8018 1367117f1b4Smrg#define GLX_PRESERVED_CONTENTS 0x801B 1377117f1b4Smrg#define GLX_LARGEST_PBUFFER 0x801C 1387117f1b4Smrg#define GLX_WIDTH 0x801D 1397117f1b4Smrg#define GLX_HEIGHT 0x801E 1407117f1b4Smrg#define GLX_EVENT_MASK 0x801F 1417117f1b4Smrg#define GLX_DAMAGED 0x8020 1427117f1b4Smrg#define GLX_SAVED 0x8021 1437117f1b4Smrg#define GLX_WINDOW 0x8022 1447117f1b4Smrg#define GLX_PBUFFER 0x8023 1457117f1b4Smrg#define GLX_PBUFFER_HEIGHT 0x8040 1467117f1b4Smrg#define GLX_PBUFFER_WIDTH 0x8041 1477117f1b4Smrg#define GLX_RGBA_BIT 0x00000001 1487117f1b4Smrg#define GLX_COLOR_INDEX_BIT 0x00000002 1497117f1b4Smrg#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 1507117f1b4Smrg 1517117f1b4Smrg 1527117f1b4Smrg/* 1537117f1b4Smrg * GLX 1.4 and later: 1547117f1b4Smrg */ 1557117f1b4Smrg#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ 1567117f1b4Smrg#define GLX_SAMPLES 0x186a1 /*100001*/ 1577117f1b4Smrg 1587117f1b4Smrg 1597117f1b4Smrg 1607117f1b4Smrgtypedef struct __GLXcontextRec *GLXContext; 1617117f1b4Smrgtypedef XID GLXPixmap; 1627117f1b4Smrgtypedef XID GLXDrawable; 1637117f1b4Smrg/* GLX 1.3 and later */ 1647117f1b4Smrgtypedef struct __GLXFBConfigRec *GLXFBConfig; 1657117f1b4Smrgtypedef XID GLXFBConfigID; 1667117f1b4Smrgtypedef XID GLXContextID; 1677117f1b4Smrgtypedef XID GLXWindow; 1687117f1b4Smrgtypedef XID GLXPbuffer; 1697117f1b4Smrg 1707117f1b4Smrg 171cdc920a0Smrg/* 172cdc920a0Smrg** Events. 173cdc920a0Smrg** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX 174cdc920a0Smrg** event - this helps initialization if the server supports the pbuffer 175cdc920a0Smrg** extension and the client doesn't. 176cdc920a0Smrg*/ 177cdc920a0Smrg#define GLX_PbufferClobber 0 178cdc920a0Smrg#define GLX_BufferSwapComplete 1 179cdc920a0Smrg 180cdc920a0Smrg#define __GLX_NUMBER_EVENTS 17 1817117f1b4Smrg 1827117f1b4Smrgextern XVisualInfo* glXChooseVisual( Display *dpy, int screen, 1837117f1b4Smrg int *attribList ); 1847117f1b4Smrg 1857117f1b4Smrgextern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, 1867117f1b4Smrg GLXContext shareList, Bool direct ); 1877117f1b4Smrg 1887117f1b4Smrgextern void glXDestroyContext( Display *dpy, GLXContext ctx ); 1897117f1b4Smrg 1907117f1b4Smrgextern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, 1917117f1b4Smrg GLXContext ctx); 1927117f1b4Smrg 1937117f1b4Smrgextern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, 1947117f1b4Smrg unsigned long mask ); 1957117f1b4Smrg 1967117f1b4Smrgextern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); 1977117f1b4Smrg 1987117f1b4Smrgextern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, 1997117f1b4Smrg Pixmap pixmap ); 2007117f1b4Smrg 2017117f1b4Smrgextern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); 2027117f1b4Smrg 2037117f1b4Smrgextern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); 2047117f1b4Smrg 2057117f1b4Smrgextern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); 2067117f1b4Smrg 2077117f1b4Smrgextern Bool glXIsDirect( Display *dpy, GLXContext ctx ); 2087117f1b4Smrg 2097117f1b4Smrgextern int glXGetConfig( Display *dpy, XVisualInfo *visual, 2107117f1b4Smrg int attrib, int *value ); 2117117f1b4Smrg 2127117f1b4Smrgextern GLXContext glXGetCurrentContext( void ); 2137117f1b4Smrg 2147117f1b4Smrgextern GLXDrawable glXGetCurrentDrawable( void ); 2157117f1b4Smrg 2167117f1b4Smrgextern void glXWaitGL( void ); 2177117f1b4Smrg 2187117f1b4Smrgextern void glXWaitX( void ); 2197117f1b4Smrg 2207117f1b4Smrgextern void glXUseXFont( Font font, int first, int count, int list ); 2217117f1b4Smrg 2227117f1b4Smrg 2237117f1b4Smrg 2247117f1b4Smrg/* GLX 1.1 and later */ 2257117f1b4Smrgextern const char *glXQueryExtensionsString( Display *dpy, int screen ); 2267117f1b4Smrg 2277117f1b4Smrgextern const char *glXQueryServerString( Display *dpy, int screen, int name ); 2287117f1b4Smrg 2297117f1b4Smrgextern const char *glXGetClientString( Display *dpy, int name ); 2307117f1b4Smrg 2317117f1b4Smrg 2327117f1b4Smrg/* GLX 1.2 and later */ 2337117f1b4Smrgextern Display *glXGetCurrentDisplay( void ); 2347117f1b4Smrg 2357117f1b4Smrg 2367117f1b4Smrg/* GLX 1.3 and later */ 2377117f1b4Smrgextern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen, 2387117f1b4Smrg const int *attribList, int *nitems ); 2397117f1b4Smrg 2407117f1b4Smrgextern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, 2417117f1b4Smrg int attribute, int *value ); 2427117f1b4Smrg 2437117f1b4Smrgextern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen, 2447117f1b4Smrg int *nelements ); 2457117f1b4Smrg 2467117f1b4Smrgextern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, 2477117f1b4Smrg GLXFBConfig config ); 2487117f1b4Smrg 2497117f1b4Smrgextern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config, 2507117f1b4Smrg Window win, const int *attribList ); 2517117f1b4Smrg 2527117f1b4Smrgextern void glXDestroyWindow( Display *dpy, GLXWindow window ); 2537117f1b4Smrg 2547117f1b4Smrgextern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config, 2557117f1b4Smrg Pixmap pixmap, const int *attribList ); 2567117f1b4Smrg 2577117f1b4Smrgextern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ); 2587117f1b4Smrg 2597117f1b4Smrgextern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config, 2607117f1b4Smrg const int *attribList ); 2617117f1b4Smrg 2627117f1b4Smrgextern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); 2637117f1b4Smrg 2647117f1b4Smrgextern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, 2657117f1b4Smrg unsigned int *value ); 2667117f1b4Smrg 2677117f1b4Smrgextern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, 2687117f1b4Smrg int renderType, GLXContext shareList, 2697117f1b4Smrg Bool direct ); 2707117f1b4Smrg 2717117f1b4Smrgextern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw, 2727117f1b4Smrg GLXDrawable read, GLXContext ctx ); 2737117f1b4Smrg 2747117f1b4Smrgextern GLXDrawable glXGetCurrentReadDrawable( void ); 2757117f1b4Smrg 2767117f1b4Smrgextern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute, 2777117f1b4Smrg int *value ); 2787117f1b4Smrg 2797117f1b4Smrgextern void glXSelectEvent( Display *dpy, GLXDrawable drawable, 2807117f1b4Smrg unsigned long mask ); 2817117f1b4Smrg 2827117f1b4Smrgextern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, 2837117f1b4Smrg unsigned long *mask ); 2847117f1b4Smrg 285c1f859d4Smrg/* GLX 1.3 function pointer typedefs */ 286c1f859d4Smrgtypedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); 287c1f859d4Smrgtypedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); 288c1f859d4Smrgtypedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); 289c1f859d4Smrgtypedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); 290c1f859d4Smrgtypedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); 291c1f859d4Smrgtypedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); 292c1f859d4Smrgtypedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); 293c1f859d4Smrgtypedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); 294c1f859d4Smrgtypedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); 295c1f859d4Smrgtypedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); 296c1f859d4Smrgtypedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); 297c1f859d4Smrgtypedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); 298c1f859d4Smrgtypedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); 299c1f859d4Smrgtypedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void); 300c1f859d4Smrgtypedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void); 301c1f859d4Smrgtypedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); 302c1f859d4Smrgtypedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); 303c1f859d4Smrgtypedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); 3047117f1b4Smrg 3057117f1b4Smrg 3067117f1b4Smrg/* 3077117f1b4Smrg * ARB 2. GLX_ARB_get_proc_address 3087117f1b4Smrg */ 3097117f1b4Smrg#ifndef GLX_ARB_get_proc_address 3107117f1b4Smrg#define GLX_ARB_get_proc_address 1 3117117f1b4Smrg 3127117f1b4Smrgtypedef void (*__GLXextFuncPtr)(void); 3137117f1b4Smrgextern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); 3147117f1b4Smrg 3157117f1b4Smrg#endif /* GLX_ARB_get_proc_address */ 3167117f1b4Smrg 3177117f1b4Smrg 3187117f1b4Smrg 319c1f859d4Smrg/* GLX 1.4 and later */ 320c1f859d4Smrgextern void (*glXGetProcAddress(const GLubyte *procname))( void ); 321c1f859d4Smrg 322c1f859d4Smrg/* GLX 1.4 function pointer typedefs */ 323c1f859d4Smrgtypedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); 324c1f859d4Smrg 325c1f859d4Smrg 326c1f859d4Smrg#ifndef GLX_GLXEXT_LEGACY 327c1f859d4Smrg 328c1f859d4Smrg#include <GL/glxext.h> 329c1f859d4Smrg 3307117f1b4Smrg#endif /* GLX_GLXEXT_LEGACY */ 3317117f1b4Smrg 3327117f1b4Smrg 3337117f1b4Smrg/** 3347117f1b4Smrg ** The following aren't in glxext.h yet. 3357117f1b4Smrg **/ 3367117f1b4Smrg 3377117f1b4Smrg 3387117f1b4Smrg/* 3397117f1b4Smrg * ???. GLX_NV_vertex_array_range 3407117f1b4Smrg */ 3417117f1b4Smrg#ifndef GLX_NV_vertex_array_range 3427117f1b4Smrg#define GLX_NV_vertex_array_range 3437117f1b4Smrg 3447117f1b4Smrgextern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); 3457117f1b4Smrgextern void glXFreeMemoryNV(GLvoid *pointer); 3467117f1b4Smrgtypedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); 3477117f1b4Smrgtypedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); 3487117f1b4Smrg 3497117f1b4Smrg#endif /* GLX_NV_vertex_array_range */ 3507117f1b4Smrg 3517117f1b4Smrg 3527117f1b4Smrg/* 3537117f1b4Smrg * ARB ?. GLX_ARB_render_texture 3547117f1b4Smrg * XXX This was never finalized! 3557117f1b4Smrg */ 3567117f1b4Smrg#ifndef GLX_ARB_render_texture 3577117f1b4Smrg#define GLX_ARB_render_texture 1 3587117f1b4Smrg 3597117f1b4Smrgextern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); 3607117f1b4Smrgextern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); 3617117f1b4Smrgextern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList); 3627117f1b4Smrg 3637117f1b4Smrg#endif /* GLX_ARB_render_texture */ 3647117f1b4Smrg 3657117f1b4Smrg 3667117f1b4Smrg/* 3677117f1b4Smrg * #?. GLX_MESA_swap_frame_usage 3687117f1b4Smrg */ 3697117f1b4Smrg#ifndef GLX_MESA_swap_frame_usage 3707117f1b4Smrg#define GLX_MESA_swap_frame_usage 1 3717117f1b4Smrg 3727117f1b4Smrgextern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage); 3737117f1b4Smrgextern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); 3747117f1b4Smrgextern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); 3757117f1b4Smrgextern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); 3767117f1b4Smrg 3777117f1b4Smrgtypedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); 3787117f1b4Smrgtypedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); 3797117f1b4Smrgtypedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); 3807117f1b4Smrgtypedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); 3817117f1b4Smrg 3827117f1b4Smrg#endif /* GLX_MESA_swap_frame_usage */ 3837117f1b4Smrg 3847117f1b4Smrg 3857117f1b4Smrg 3867117f1b4Smrg/* 3877117f1b4Smrg * #?. GLX_MESA_swap_control 3887117f1b4Smrg */ 3897117f1b4Smrg#ifndef GLX_MESA_swap_control 3907117f1b4Smrg#define GLX_MESA_swap_control 1 3917117f1b4Smrg 3927117f1b4Smrgextern int glXSwapIntervalMESA(unsigned int interval); 3937117f1b4Smrgextern int glXGetSwapIntervalMESA(void); 3947117f1b4Smrg 3957117f1b4Smrgtypedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval); 3967117f1b4Smrgtypedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); 3977117f1b4Smrg 3987117f1b4Smrg#endif /* GLX_MESA_swap_control */ 3997117f1b4Smrg 4007117f1b4Smrg 4017117f1b4Smrg/*** Should these go here, or in another header? */ 4027117f1b4Smrg/* 4037117f1b4Smrg** GLX Events 4047117f1b4Smrg*/ 4057117f1b4Smrgtypedef struct { 4067117f1b4Smrg int event_type; /* GLX_DAMAGED or GLX_SAVED */ 4077117f1b4Smrg int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ 4087117f1b4Smrg unsigned long serial; /* # of last request processed by server */ 4097117f1b4Smrg Bool send_event; /* true if this came for SendEvent request */ 4107117f1b4Smrg Display *display; /* display the event was read from */ 4117117f1b4Smrg GLXDrawable drawable; /* XID of Drawable */ 4127117f1b4Smrg unsigned int buffer_mask; /* mask indicating which buffers are affected */ 4137117f1b4Smrg unsigned int aux_buffer; /* which aux buffer was affected */ 4147117f1b4Smrg int x, y; 4157117f1b4Smrg int width, height; 4167117f1b4Smrg int count; /* if nonzero, at least this many more */ 4177117f1b4Smrg} GLXPbufferClobberEvent; 4187117f1b4Smrg 419cdc920a0Smrgtypedef struct { 420cdc920a0Smrg int type; 421cdc920a0Smrg unsigned long serial; /* # of last request processed by server */ 422cdc920a0Smrg Bool send_event; /* true if this came from a SendEvent request */ 423cdc920a0Smrg Display *display; /* Display the event was read from */ 424af69d88dSmrg Drawable drawable; /* drawable on which event was requested in event mask */ 425cdc920a0Smrg int event_type; 426cdc920a0Smrg int64_t ust; 427cdc920a0Smrg int64_t msc; 428cdc920a0Smrg int64_t sbc; 429cdc920a0Smrg} GLXBufferSwapComplete; 430cdc920a0Smrg 4317117f1b4Smrgtypedef union __GLXEvent { 4327117f1b4Smrg GLXPbufferClobberEvent glxpbufferclobber; 433cdc920a0Smrg GLXBufferSwapComplete glxbufferswapcomplete; 4347117f1b4Smrg long pad[24]; 4357117f1b4Smrg} GLXEvent; 4367117f1b4Smrg 4377117f1b4Smrg#ifdef __cplusplus 4387117f1b4Smrg} 4397117f1b4Smrg#endif 4407117f1b4Smrg 4417117f1b4Smrg#endif 442