Back to index

x11proto-gl  1.4.16
glcore.h
Go to the documentation of this file.
00001 #ifndef __gl_core_h_
00002 #define __gl_core_h_
00003 
00004 /*
00005  * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
00006  * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining a
00009  * copy of this software and associated documentation files (the "Software"),
00010  * to deal in the Software without restriction, including without limitation
00011  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00012  * and/or sell copies of the Software, and to permit persons to whom the
00013  * Software is furnished to do so, subject to the following conditions:
00014  *
00015  * The above copyright notice including the dates of first publication and
00016  * either this permission notice or a reference to
00017  * http://oss.sgi.com/projects/FreeB/
00018  * shall be included in all copies or substantial portions of the Software.
00019  *
00020  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00022  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00023  * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
00024  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
00025  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00026  * SOFTWARE.
00027  *
00028  * Except as contained in this notice, the name of Silicon Graphics, Inc.
00029  * shall not be used in advertising or otherwise to promote the sale, use or
00030  * other dealings in this Software without prior written authorization from
00031  * Silicon Graphics, Inc.
00032  */
00033 
00034 #if !defined(_WIN32_WCE)
00035 #include <sys/types.h>
00036 #endif
00037 
00038 #define GL_CORE_SGI  1
00039 #define GL_CORE_MESA 2
00040 #define GL_CORE_APPLE 4
00041 #define GL_CORE_WINDOWS 8
00042 
00043 typedef struct __GLcontextRec __GLcontext;
00044 
00045 /*
00046 ** This file defines the interface between the GL core and the surrounding
00047 ** "operating system" that supports it (currently the GLX or WGL extensions).
00048 **
00049 ** Members (data and function pointers) are documented as imported or
00050 ** exported according to how they are used by the core rendering functions.
00051 ** Imported members are initialized by the "operating system" and used by
00052 ** the core functions.  Exported members are initialized by the core functions
00053 ** and used by the "operating system".
00054 */
00055 
00068 typedef struct __GLcontextModesRec {
00069     struct __GLcontextModesRec * next;
00070 
00071     GLboolean rgbMode;
00072     GLboolean floatMode;
00073     GLboolean colorIndexMode;
00074     GLuint doubleBufferMode;
00075     GLuint stereoMode;
00076 
00077     GLboolean haveAccumBuffer;
00078     GLboolean haveDepthBuffer;
00079     GLboolean haveStencilBuffer;
00080 
00081     GLint redBits, greenBits, blueBits, alphaBits;      /* bits per comp */
00082     GLuint redMask, greenMask, blueMask, alphaMask;
00083     GLint rgbBits;          /* total bits for rgb */
00084     GLint indexBits;        /* total bits for colorindex */
00085 
00086     GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
00087     GLint depthBits;
00088     GLint stencilBits;
00089 
00090     GLint numAuxBuffers;
00091 
00092     GLint level;
00093 
00094     GLint pixmapMode;
00095 
00096     /* GLX */
00097     GLint visualID;
00098     GLint visualType;     
00102     /* EXT_visual_rating / GLX 1.2 */
00103     GLint visualRating;
00104 
00105     /* EXT_visual_info / GLX 1.2 */
00106     GLint transparentPixel;
00107                             /*    colors are floats scaled to ints */
00108     GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
00109     GLint transparentIndex;
00110 
00111     /* ARB_multisample / SGIS_multisample */
00112     GLint sampleBuffers;
00113     GLint samples;
00114 
00115     /* SGIX_fbconfig / GLX 1.3 */
00116     GLint drawableType;
00117     GLint renderType;
00118     GLint xRenderable;
00119     GLint fbconfigID;
00120 
00121     /* SGIX_pbuffer / GLX 1.3 */
00122     GLint maxPbufferWidth;
00123     GLint maxPbufferHeight;
00124     GLint maxPbufferPixels;
00125     GLint optimalPbufferWidth;   /* Only for SGIX_pbuffer. */
00126     GLint optimalPbufferHeight;  /* Only for SGIX_pbuffer. */
00127 
00128     /* SGIX_visual_select_group */
00129     GLint visualSelectGroup;
00130 
00131     /* OML_swap_method */
00132     GLint swapMethod;
00133 
00134     GLint screen;
00135 
00136     /* EXT_texture_from_pixmap */
00137     GLint bindToTextureRgb;
00138     GLint bindToTextureRgba;
00139     GLint bindToMipmapTexture;
00140     GLint bindToTextureTargets;
00141     GLint yInverted;
00142 } __GLcontextModes;
00143 
00144 /* Several fields of __GLcontextModes can take these as values.  Since
00145  * GLX header files may not be available everywhere they need to be used,
00146  * redefine them here.
00147  */
00148 #define GLX_NONE                           0x8000
00149 #define GLX_SLOW_CONFIG                    0x8001
00150 #define GLX_TRUE_COLOR                     0x8002
00151 #define GLX_DIRECT_COLOR                   0x8003
00152 #define GLX_PSEUDO_COLOR                   0x8004
00153 #define GLX_STATIC_COLOR                   0x8005
00154 #define GLX_GRAY_SCALE                     0x8006
00155 #define GLX_STATIC_GRAY                    0x8007
00156 #define GLX_TRANSPARENT_RGB                0x8008
00157 #define GLX_TRANSPARENT_INDEX              0x8009
00158 #define GLX_NON_CONFORMANT_CONFIG          0x800D
00159 #define GLX_SWAP_EXCHANGE_OML              0x8061
00160 #define GLX_SWAP_COPY_OML                  0x8062
00161 #define GLX_SWAP_UNDEFINED_OML             0x8063
00162 
00163 #define GLX_DONT_CARE                      0xFFFFFFFF
00164 
00165 #define GLX_RGBA_BIT                       0x00000001
00166 #define GLX_COLOR_INDEX_BIT                0x00000002
00167 #define GLX_WINDOW_BIT                     0x00000001
00168 #define GLX_PIXMAP_BIT                     0x00000002
00169 #define GLX_PBUFFER_BIT                    0x00000004
00170 
00171 #define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
00172 #define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
00173 #define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
00174 #define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
00175 #define GLX_Y_INVERTED_EXT                 0x20D4
00176 
00177 #define GLX_TEXTURE_1D_BIT_EXT             0x00000001
00178 #define GLX_TEXTURE_2D_BIT_EXT             0x00000002
00179 #define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
00180 
00181 #endif /* __gl_core_h_ */