glcore.h revision e3c1c5377c7fcd17085bfb22fbc1cf30646751ba
1#ifndef __gl_core_h_
2#define __gl_core_h_
3
4/*
5 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
6 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice including the dates of first publication and
16 * either this permission notice or a reference to
17 * http://oss.sgi.com/projects/FreeB/
18 * shall be included in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 *
28 * Except as contained in this notice, the name of Silicon Graphics, Inc.
29 * shall not be used in advertising or otherwise to promote the sale, use or
30 * other dealings in this Software without prior written authorization from
31 * Silicon Graphics, Inc.
32 */
33
34#if !defined(_WIN32_WCE)
35#include <sys/types.h>
36#endif
37
38#define GL_CORE_SGI  1
39#define GL_CORE_MESA 2
40#define GL_CORE_APPLE 4
41#define GL_CORE_WINDOWS 8
42
43typedef struct __GLcontextRec __GLcontext;
44
45/*
46** This file defines the interface between the GL core and the surrounding
47** "operating system" that supports it (currently the GLX or WGL extensions).
48**
49** Members (data and function pointers) are documented as imported or
50** exported according to how they are used by the core rendering functions.
51** Imported members are initialized by the "operating system" and used by
52** the core functions.  Exported members are initialized by the core functions
53** and used by the "operating system".
54*/
55
56/**
57 * Mode and limit information for a context.  This information is
58 * kept around in the context so that values can be used during
59 * command execution, and for returning information about the
60 * context to the application.
61 *
62 * Instances of this structure are shared by the driver and the loader.  To
63 * maintain binary compatability, new fields \b must be added only to the
64 * end of the structure.
65 *
66 * \sa _gl_context_modes_create
67 */
68typedef struct __GLcontextModesRec {
69    struct __GLcontextModesRec * next;
70
71    GLboolean rgbMode;
72    GLboolean floatMode;
73    GLboolean colorIndexMode;
74    GLuint doubleBufferMode;
75    GLuint stereoMode;
76
77    GLboolean haveAccumBuffer;
78    GLboolean haveDepthBuffer;
79    GLboolean haveStencilBuffer;
80
81    GLint redBits, greenBits, blueBits, alphaBits;	/* bits per comp */
82    GLuint redMask, greenMask, blueMask, alphaMask;
83    GLint rgbBits;		/* total bits for rgb */
84    GLint indexBits;		/* total bits for colorindex */
85
86    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
87    GLint depthBits;
88    GLint stencilBits;
89
90    GLint numAuxBuffers;
91
92    GLint level;
93
94    GLint pixmapMode;
95
96    /* GLX */
97    GLint visualID;
98    GLint visualType;     /**< One of the GLX X visual types. (i.e.,
99			   * \c GLX_TRUE_COLOR, etc.)
100			   */
101
102    /* EXT_visual_rating / GLX 1.2 */
103    GLint visualRating;
104
105    /* EXT_visual_info / GLX 1.2 */
106    GLint transparentPixel;
107				/*    colors are floats scaled to ints */
108    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
109    GLint transparentIndex;
110
111    /* ARB_multisample / SGIS_multisample */
112    GLint sampleBuffers;
113    GLint samples;
114
115    /* SGIX_fbconfig / GLX 1.3 */
116    GLint drawableType;
117    GLint renderType;
118    GLint xRenderable;
119    GLint fbconfigID;
120
121    /* SGIX_pbuffer / GLX 1.3 */
122    GLint maxPbufferWidth;
123    GLint maxPbufferHeight;
124    GLint maxPbufferPixels;
125    GLint optimalPbufferWidth;   /* Only for SGIX_pbuffer. */
126    GLint optimalPbufferHeight;  /* Only for SGIX_pbuffer. */
127
128    /* SGIX_visual_select_group */
129    GLint visualSelectGroup;
130
131    /* OML_swap_method */
132    GLint swapMethod;
133
134    GLint screen;
135
136    /* EXT_texture_from_pixmap */
137    GLint bindToTextureRgb;
138    GLint bindToTextureRgba;
139    GLint bindToMipmapTexture;
140    GLint bindToTextureTargets;
141    GLint yInverted;
142} __GLcontextModes;
143
144/* Several fields of __GLcontextModes can take these as values.  Since
145 * GLX header files may not be available everywhere they need to be used,
146 * redefine them here.
147 */
148#define GLX_NONE                           0x8000
149#define GLX_SLOW_CONFIG                    0x8001
150#define GLX_TRUE_COLOR                     0x8002
151#define GLX_DIRECT_COLOR                   0x8003
152#define GLX_PSEUDO_COLOR                   0x8004
153#define GLX_STATIC_COLOR                   0x8005
154#define GLX_GRAY_SCALE                     0x8006
155#define GLX_STATIC_GRAY                    0x8007
156#define GLX_TRANSPARENT_RGB                0x8008
157#define GLX_TRANSPARENT_INDEX              0x8009
158#define GLX_NON_CONFORMANT_CONFIG          0x800D
159#define GLX_SWAP_EXCHANGE_OML              0x8061
160#define GLX_SWAP_COPY_OML                  0x8062
161#define GLX_SWAP_UNDEFINED_OML             0x8063
162
163#define GLX_DONT_CARE                      0xFFFFFFFF
164
165#define GLX_RGBA_BIT                       0x00000001
166#define GLX_COLOR_INDEX_BIT                0x00000002
167#define GLX_WINDOW_BIT                     0x00000001
168#define GLX_PIXMAP_BIT                     0x00000002
169#define GLX_PBUFFER_BIT                    0x00000004
170
171#define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
172#define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
173#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
174#define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
175#define GLX_Y_INVERTED_EXT                 0x20D4
176
177#define GLX_TEXTURE_1D_BIT_EXT             0x00000001
178#define GLX_TEXTURE_2D_BIT_EXT             0x00000002
179#define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
180
181#endif /* __gl_core_h_ */
182