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#include <sys/types.h>
35
36#define GL_CORE_SGI  1
37#define GL_CORE_MESA 2
38#define GL_CORE_APPLE 4
39#define GL_CORE_WINDOWS 8
40
41typedef struct __GLcontextRec __GLcontext;
42
43/*
44** This file defines the interface between the GL core and the surrounding
45** "operating system" that supports it (currently the GLX or WGL extensions).
46**
47** Members (data and function pointers) are documented as imported or
48** exported according to how they are used by the core rendering functions.
49** Imported members are initialized by the "operating system" and used by
50** the core functions.  Exported members are initialized by the core functions
51** and used by the "operating system".
52*/
53
54/**
55 * Mode and limit information for a context.  This information is
56 * kept around in the context so that values can be used during
57 * command execution, and for returning information about the
58 * context to the application.
59 *
60 * Instances of this structure are shared by the driver and the loader.  To
61 * maintain binary compatability, new fields \b must be added only to the
62 * end of the structure.
63 *
64 * \sa _gl_context_modes_create
65 */
66typedef struct __GLcontextModesRec {
67    struct __GLcontextModesRec * next;
68
69    GLboolean rgbMode;
70    GLboolean floatMode;
71    GLboolean colorIndexMode;
72    GLuint doubleBufferMode;
73    GLuint stereoMode;
74
75    GLboolean haveAccumBuffer;
76    GLboolean haveDepthBuffer;
77    GLboolean haveStencilBuffer;
78
79    GLint redBits, greenBits, blueBits, alphaBits;	/* bits per comp */
80    GLuint redMask, greenMask, blueMask, alphaMask;
81    GLint rgbBits;		/* total bits for rgb */
82    GLint indexBits;		/* total bits for colorindex */
83
84    GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
85    GLint depthBits;
86    GLint stencilBits;
87
88    GLint numAuxBuffers;
89
90    GLint level;
91
92    GLint pixmapMode;
93
94    /* GLX */
95    GLint visualID;
96    GLint visualType;     /**< One of the GLX X visual types. (i.e.,
97			   * \c GLX_TRUE_COLOR, etc.)
98			   */
99
100    /* EXT_visual_rating / GLX 1.2 */
101    GLint visualRating;
102
103    /* EXT_visual_info / GLX 1.2 */
104    GLint transparentPixel;
105				/*    colors are floats scaled to ints */
106    GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
107    GLint transparentIndex;
108
109    /* ARB_multisample / SGIS_multisample */
110    GLint sampleBuffers;
111    GLint samples;
112
113    /* SGIX_fbconfig / GLX 1.3 */
114    GLint drawableType;
115    GLint renderType;
116    GLint xRenderable;
117    GLint fbconfigID;
118
119    /* SGIX_pbuffer / GLX 1.3 */
120    GLint maxPbufferWidth;
121    GLint maxPbufferHeight;
122    GLint maxPbufferPixels;
123    GLint optimalPbufferWidth;   /* Only for SGIX_pbuffer. */
124    GLint optimalPbufferHeight;  /* Only for SGIX_pbuffer. */
125
126    /* SGIX_visual_select_group */
127    GLint visualSelectGroup;
128
129    /* OML_swap_method */
130    GLint swapMethod;
131
132    GLint screen;
133
134    /* EXT_texture_from_pixmap */
135    GLint bindToTextureRgb;
136    GLint bindToTextureRgba;
137    GLint bindToMipmapTexture;
138    GLint bindToTextureTargets;
139    GLint yInverted;
140} __GLcontextModes;
141
142/* Several fields of __GLcontextModes can take these as values.  Since
143 * GLX header files may not be available everywhere they need to be used,
144 * redefine them here.
145 */
146#define GLX_NONE                           0x8000
147#define GLX_SLOW_CONFIG                    0x8001
148#define GLX_TRUE_COLOR                     0x8002
149#define GLX_DIRECT_COLOR                   0x8003
150#define GLX_PSEUDO_COLOR                   0x8004
151#define GLX_STATIC_COLOR                   0x8005
152#define GLX_GRAY_SCALE                     0x8006
153#define GLX_STATIC_GRAY                    0x8007
154#define GLX_TRANSPARENT_RGB                0x8008
155#define GLX_TRANSPARENT_INDEX              0x8009
156#define GLX_NON_CONFORMANT_CONFIG          0x800D
157#define GLX_SWAP_EXCHANGE_OML              0x8061
158#define GLX_SWAP_COPY_OML                  0x8062
159#define GLX_SWAP_UNDEFINED_OML             0x8063
160
161#define GLX_DONT_CARE                      0xFFFFFFFF
162
163#define GLX_RGBA_BIT                       0x00000001
164#define GLX_COLOR_INDEX_BIT                0x00000002
165#define GLX_WINDOW_BIT                     0x00000001
166#define GLX_PIXMAP_BIT                     0x00000002
167#define GLX_PBUFFER_BIT                    0x00000004
168
169#define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
170#define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
171#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
172#define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
173#define GLX_Y_INVERTED_EXT                 0x20D4
174
175#define GLX_TEXTURE_1D_BIT_EXT             0x00000001
176#define GLX_TEXTURE_2D_BIT_EXT             0x00000002
177#define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
178
179#endif /* __gl_core_h_ */
180