1 /* $Id$ */ 2 3 /* 4 * Mesa 3-D graphics library 5 * Version: 4.1 6 * 7 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included 17 * in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 */ 26 27 28 #ifndef GLX_H 29 #define GLX_H 30 31 32 #ifdef __VMS 33 #include <GL/vms_x_fix.h> 34 # ifdef __cplusplus 35 /* VMS Xlib.h gives problems with C++. 36 * this avoids a bunch of trivial warnings */ 37 #pragma message disable nosimpint 38 #endif 39 #endif 40 #include <X11/Xlib.h> 41 #include <X11/Xutil.h> 42 #ifdef __VMS 43 # ifdef __cplusplus 44 #pragma message enable nosimpint 45 #endif 46 #endif 47 48 // Due to 'glext-supplement.h', we prefer to include it manually afterwards. 49 // This gives us the same behavior as the vanilla GLES, GLES2, GLES3 and glcorearb header. 50 // #include <GL/gl.h> 51 52 #if defined(USE_MGL_NAMESPACE) 53 #include <GL/glx_mangle.h> 54 #endif 55 56 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 61 #ifndef GLX_VERSION_1_0 62 #define GLX_VERSION_1_0 1 63 64 #define GLX_EXTENSION_NAME "GLX" 65 66 /* 67 * Tokens for glXChooseVisual and glXGetConfig: 68 */ 69 #define GLX_USE_GL 1 70 #define GLX_BUFFER_SIZE 2 71 #define GLX_LEVEL 3 72 #define GLX_RGBA 4 73 #define GLX_DOUBLEBUFFER 5 74 #define GLX_STEREO 6 75 #define GLX_AUX_BUFFERS 7 76 #define GLX_RED_SIZE 8 77 #define GLX_GREEN_SIZE 9 78 #define GLX_BLUE_SIZE 10 79 #define GLX_ALPHA_SIZE 11 80 #define GLX_DEPTH_SIZE 12 81 #define GLX_STENCIL_SIZE 13 82 #define GLX_ACCUM_RED_SIZE 14 83 #define GLX_ACCUM_GREEN_SIZE 15 84 #define GLX_ACCUM_BLUE_SIZE 16 85 #define GLX_ACCUM_ALPHA_SIZE 17 86 87 88 /* 89 * Error codes returned by glXGetConfig: 90 */ 91 #define GLX_BAD_SCREEN 1 92 #define GLX_BAD_ATTRIBUTE 2 93 #define GLX_NO_EXTENSION 3 94 #define GLX_BAD_VISUAL 4 95 #define GLX_BAD_CONTEXT 5 96 #define GLX_BAD_VALUE 6 97 #define GLX_BAD_ENUM 7 98 99 typedef struct __GLXcontextRec *GLXContext; 100 typedef XID GLXPixmap; 101 typedef XID GLXDrawable; 102 103 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, 104 int *attribList ); 105 106 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, 107 GLXContext shareList, Bool direct ); 108 109 extern void glXDestroyContext( Display *dpy, GLXContext ctx ); 110 111 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, 112 GLXContext ctx); 113 114 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, 115 unsigned long mask ); 116 117 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); 118 119 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, 120 Pixmap pixmap ); 121 122 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); 123 124 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); 125 126 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); 127 128 extern Bool glXIsDirect( Display *dpy, GLXContext ctx ); 129 130 extern int glXGetConfig( Display *dpy, XVisualInfo *visual, 131 int attrib, int *value ); 132 133 extern GLXContext glXGetCurrentContext( void ); 134 135 extern GLXDrawable glXGetCurrentDrawable( void ); 136 137 extern void glXWaitGL( void ); 138 139 extern void glXWaitX( void ); 140 141 extern void glXUseXFont( Font font, int first, int count, int list ); 142 143 144 #endif /* GLX_VERSION_1_0 */ 145 146 147 #ifndef GLX_VERSION_1_1 148 #define GLX_VERSION_1_1 1 149 150 #define GLX_VENDOR 1 151 #define GLX_VERSION 2 152 #define GLX_EXTENSIONS 3 153 154 extern const char *glXQueryExtensionsString( Display *dpy, int screen ); 155 156 extern const char *glXQueryServerString( Display *dpy, int screen, int name ); 157 158 extern const char *glXGetClientString( Display *dpy, int name ); 159 160 #endif /* GLX_VERSION_1_1 */ 161 162 163 #ifndef GLX_VERSION_1_2 164 #define GLX_VERSION_1_2 1 165 166 extern Display *glXGetCurrentDisplay( void ); 167 168 #endif /* GLX_VERSION_1_2 */ 169 170 /** 171 * We require 'glXGetProcAddress' and 'glXGetProcAddressARB' 172 * to be available in GLX, rather than GLXExt. 173 */ 174 #ifndef GLX_VERSION_1_4 175 #define GLX_VERSION_1_4 1 176 177 typedef void ( *__GLXextFuncPtr)(void); 178 #define GLX_SAMPLE_BUFFERS 100000 179 #define GLX_SAMPLES 100001 180 typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); 181 #ifdef GLX_GLXEXT_PROTOTYPES 182 __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName); 183 #endif 184 #endif /* GLX_VERSION_1_4 */ 185 186 #ifndef GLX_ARB_get_proc_address 187 #define GLX_ARB_get_proc_address 1 188 typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); 189 #ifdef GLX_GLXEXT_PROTOTYPES 190 __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); 191 #endif 192 #endif /* GLX_ARB_get_proc_address */ 193 194 // Due to 'glext-supplement.h', we prefer to include it manually afterwards. 195 // This gives us the same behavior as the vanilla GLES, GLES2, GLES3 and glcorearb header. 196 // #include <GL/glxext.h> 197 198 #ifdef __cplusplus 199 } 200 #endif 201 202 #endif 203