glx: Stop using glcore.h and glxint.h in glx
[mesa.git] / src / glx / glcontextmodes.h
1 /*
2 * (C) Copyright IBM Corporation 2003
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /**
26 * \file glcontextmodes.h
27 * \author Ian Romanick <idr@us.ibm.com>
28 */
29
30 #ifndef GLCONTEXTMODES_H
31 #define GLCONTEXTMODES_H
32
33 typedef struct __GLcontextModesRec {
34 struct __GLcontextModesRec * next;
35
36 GLboolean rgbMode;
37 GLboolean floatMode;
38 GLboolean colorIndexMode;
39 GLuint doubleBufferMode;
40 GLuint stereoMode;
41
42 GLboolean haveAccumBuffer;
43 GLboolean haveDepthBuffer;
44 GLboolean haveStencilBuffer;
45
46 GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
47 GLuint redMask, greenMask, blueMask, alphaMask;
48 GLint rgbBits; /* total bits for rgb */
49 GLint indexBits; /* total bits for colorindex */
50
51 GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
52 GLint depthBits;
53 GLint stencilBits;
54
55 GLint numAuxBuffers;
56
57 GLint level;
58
59 GLint pixmapMode;
60
61 /* GLX */
62 GLint visualID;
63 GLint visualType; /**< One of the GLX X visual types. (i.e.,
64 * \c GLX_TRUE_COLOR, etc.)
65 */
66
67 /* EXT_visual_rating / GLX 1.2 */
68 GLint visualRating;
69
70 /* EXT_visual_info / GLX 1.2 */
71 GLint transparentPixel;
72 /* colors are floats scaled to ints */
73 GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
74 GLint transparentIndex;
75
76 /* ARB_multisample / SGIS_multisample */
77 GLint sampleBuffers;
78 GLint samples;
79
80 /* SGIX_fbconfig / GLX 1.3 */
81 GLint drawableType;
82 GLint renderType;
83 GLint xRenderable;
84 GLint fbconfigID;
85
86 /* SGIX_pbuffer / GLX 1.3 */
87 GLint maxPbufferWidth;
88 GLint maxPbufferHeight;
89 GLint maxPbufferPixels;
90 GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
91 GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
92
93 /* SGIX_visual_select_group */
94 GLint visualSelectGroup;
95
96 /* OML_swap_method */
97 GLint swapMethod;
98
99 GLint screen;
100
101 /* EXT_texture_from_pixmap */
102 GLint bindToTextureRgb;
103 GLint bindToTextureRgba;
104 GLint bindToMipmapTexture;
105 GLint bindToTextureTargets;
106 GLint yInverted;
107 } __GLcontextModes;
108
109 #define __GLX_MIN_CONFIG_PROPS 18
110 #define __GLX_MAX_CONFIG_PROPS 500
111 #define __GLX_EXT_CONFIG_PROPS 10
112
113 /*
114 ** Since we send all non-core visual properties as token, value pairs,
115 ** we require 2 words across the wire. In order to maintain backwards
116 ** compatibility, we need to send the total number of words that the
117 ** VisualConfigs are sent back in so old libraries can simply "ignore"
118 ** the new properties.
119 */
120 #define __GLX_TOTAL_CONFIG \
121 (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS)
122
123 extern GLint _gl_convert_from_x_visual_type(int visualType);
124 extern GLint _gl_convert_to_x_visual_type(int visualType);
125 extern int _gl_get_context_mode_data(const __GLcontextModes * mode,
126 int attribute, int *value_return);
127
128 extern __GLcontextModes *_gl_context_modes_create(unsigned count,
129 size_t minimum_size);
130 extern void _gl_context_modes_destroy(__GLcontextModes * modes);
131 extern __GLcontextModes *_gl_context_modes_find_visual(__GLcontextModes *
132 modes, int vid);
133 extern __GLcontextModes *_gl_context_modes_find_fbconfig(__GLcontextModes *
134 modes, int fbid);
135 extern GLboolean _gl_context_modes_are_same(const __GLcontextModes * a,
136 const __GLcontextModes * b);
137
138 #endif /* GLCONTEXTMODES_H */