Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
[mesa.git] / include / GL / internal / glcore.h
1 #ifndef __gl_core_h_
2 #define __gl_core_h_
3
4 /*
5 ** License Applicability. Except to the extent portions of this file are
6 ** made subject to an alternative license as permitted in the SGI Free
7 ** Software License B, Version 1.1 (the "License"), the contents of this
8 ** file are subject only to the provisions of the License. You may not use
9 ** this file except in compliance with the License. You may obtain a copy
10 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
11 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
12 **
13 ** http://oss.sgi.com/projects/FreeB
14 **
15 ** Note that, as provided in the License, the Software is distributed on an
16 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
17 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
18 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
19 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
20 **
21 ** Original Code. The Original Code is: OpenGL Sample Implementation,
22 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
23 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
24 ** Copyright in any portions created by third parties is as indicated
25 ** elsewhere herein. All Rights Reserved.
26 **
27 ** Additional Notice Provisions: The application programming interfaces
28 ** established by SGI in conjunction with the Original Code are The
29 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
30 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
31 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
32 ** Window System(R) (Version 1.3), released October 19, 1998. This software
33 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
34 ** published by SGI, but has not been independently verified as being
35 ** compliant with the OpenGL(R) version 1.2.1 Specification.
36 **
37 */
38
39 #include <sys/types.h>
40
41 #define GL_CORE_SGI 1
42 #define GL_CORE_MESA 2
43 #define GL_CORE_APPLE 4
44 #define GL_CORE_WINDOWS 8
45
46 typedef struct __GLcontextRec __GLcontext;
47
48 /*
49 ** This file defines the interface between the GL core and the surrounding
50 ** "operating system" that supports it (currently the GLX or WGL extensions).
51 **
52 ** Members (data and function pointers) are documented as imported or
53 ** exported according to how they are used by the core rendering functions.
54 ** Imported members are initialized by the "operating system" and used by
55 ** the core functions. Exported members are initialized by the core functions
56 ** and used by the "operating system".
57 */
58
59 /**
60 * Mode and limit information for a context. This information is
61 * kept around in the context so that values can be used during
62 * command execution, and for returning information about the
63 * context to the application.
64 *
65 * Instances of this structure are shared by the driver and the loader. To
66 * maintain binary compatability, new fields \b must be added only to the
67 * end of the structure.
68 *
69 * \sa _gl_context_modes_create
70 */
71 typedef struct __GLcontextModesRec {
72 struct __GLcontextModesRec * next;
73
74 GLboolean rgbMode;
75 GLboolean floatMode;
76 GLboolean colorIndexMode;
77 GLuint doubleBufferMode;
78 GLuint stereoMode;
79
80 GLboolean haveAccumBuffer;
81 GLboolean haveDepthBuffer;
82 GLboolean haveStencilBuffer;
83
84 GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
85 GLuint redMask, greenMask, blueMask, alphaMask;
86 GLint rgbBits; /* total bits for rgb */
87 GLint indexBits; /* total bits for colorindex */
88
89 GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
90 GLint depthBits;
91 GLint stencilBits;
92
93 GLint numAuxBuffers;
94
95 GLint level;
96
97 GLint pixmapMode;
98
99 /* GLX */
100 GLint visualID;
101 GLint visualType; /**< One of the GLX X visual types. (i.e.,
102 * \c GLX_TRUE_COLOR, etc.)
103 */
104
105 /* EXT_visual_rating / GLX 1.2 */
106 GLint visualRating;
107
108 /* EXT_visual_info / GLX 1.2 */
109 GLint transparentPixel;
110 /* colors are floats scaled to ints */
111 GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
112 GLint transparentIndex;
113
114 /* ARB_multisample / SGIS_multisample */
115 GLint sampleBuffers;
116 GLint samples;
117
118 /* SGIX_fbconfig / GLX 1.3 */
119 GLint drawableType;
120 GLint renderType;
121 GLint xRenderable;
122 GLint fbconfigID;
123
124 /* SGIX_pbuffer / GLX 1.3 */
125 GLint maxPbufferWidth;
126 GLint maxPbufferHeight;
127 GLint maxPbufferPixels;
128 GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
129 GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
130
131 /* SGIX_visual_select_group */
132 GLint visualSelectGroup;
133
134 /* OML_swap_method */
135 GLint swapMethod;
136
137 GLint screen;
138
139 /* EXT_texture_from_pixmap */
140 GLint bindToTextureRgb;
141 GLint bindToTextureRgba;
142 GLint bindToMipmapTexture;
143 GLint bindToTextureTargets;
144 GLint yInverted;
145 } __GLcontextModes;
146
147 /* Several fields of __GLcontextModes can take these as values. Since
148 * GLX header files may not be available everywhere they need to be used,
149 * redefine them here.
150 */
151 #define GLX_NONE 0x8000
152 #define GLX_SLOW_CONFIG 0x8001
153 #define GLX_TRUE_COLOR 0x8002
154 #define GLX_DIRECT_COLOR 0x8003
155 #define GLX_PSEUDO_COLOR 0x8004
156 #define GLX_STATIC_COLOR 0x8005
157 #define GLX_GRAY_SCALE 0x8006
158 #define GLX_STATIC_GRAY 0x8007
159 #define GLX_TRANSPARENT_RGB 0x8008
160 #define GLX_TRANSPARENT_INDEX 0x8009
161 #define GLX_NON_CONFORMANT_CONFIG 0x800D
162 #define GLX_SWAP_EXCHANGE_OML 0x8061
163 #define GLX_SWAP_COPY_OML 0x8062
164 #define GLX_SWAP_UNDEFINED_OML 0x8063
165
166 #define GLX_DONT_CARE 0xFFFFFFFF
167
168 #define GLX_RGBA_BIT 0x00000001
169 #define GLX_COLOR_INDEX_BIT 0x00000002
170 #define GLX_WINDOW_BIT 0x00000001
171 #define GLX_PIXMAP_BIT 0x00000002
172 #define GLX_PBUFFER_BIT 0x00000004
173
174 #define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
175 #define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
176 #define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
177 #define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
178 #define GLX_Y_INVERTED_EXT 0x20D4
179
180 #define GLX_TEXTURE_1D_BIT_EXT 0x00000001
181 #define GLX_TEXTURE_2D_BIT_EXT 0x00000002
182 #define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
183
184 #endif /* __gl_core_h_ */