b8e9271daff6b977409a031bc1bb7c2a0d066bd3
[mesa.git] / src / glx / glxconfig.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 struct glx_config {
34 struct glx_config * next;
35
36 GLuint doubleBufferMode;
37 GLuint stereoMode;
38
39 GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
40 GLuint redMask, greenMask, blueMask, alphaMask;
41 GLint rgbBits; /* total bits for rgb */
42 GLint indexBits; /* total bits for colorindex */
43
44 GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
45 GLint depthBits;
46 GLint stencilBits;
47
48 GLint numAuxBuffers;
49
50 GLint level;
51
52 /* GLX */
53 GLint visualID;
54 GLint visualType; /**< One of the GLX X visual types. (i.e.,
55 * \c GLX_TRUE_COLOR, etc.)
56 */
57
58 /* EXT_visual_rating / GLX 1.2 */
59 GLint visualRating;
60
61 /* EXT_visual_info / GLX 1.2 */
62 GLint transparentPixel;
63 /* colors are floats scaled to ints */
64 GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha;
65 GLint transparentIndex;
66
67 /* ARB_multisample / SGIS_multisample */
68 GLint sampleBuffers;
69 GLint samples;
70
71 /* SGIX_fbconfig / GLX 1.3 */
72 GLint drawableType;
73 GLint renderType;
74 GLint xRenderable;
75 GLint fbconfigID;
76
77 /* SGIX_pbuffer / GLX 1.3 */
78 GLint maxPbufferWidth;
79 GLint maxPbufferHeight;
80 GLint maxPbufferPixels;
81 GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */
82 GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */
83
84 /* SGIX_visual_select_group */
85 GLint visualSelectGroup;
86
87 /* OML_swap_method */
88 GLint swapMethod;
89
90 GLint screen;
91
92 /* EXT_texture_from_pixmap */
93 GLint bindToTextureRgb;
94 GLint bindToTextureRgba;
95 GLint bindToMipmapTexture;
96 GLint bindToTextureTargets;
97 GLint yInverted;
98
99 /* EXT_framebuffer_sRGB */
100 GLint sRGBCapable;
101 };
102
103 #define __GLX_MIN_CONFIG_PROPS 18
104 #define __GLX_MAX_CONFIG_PROPS 500
105 #define __GLX_EXT_CONFIG_PROPS 10
106
107 /*
108 ** Since we send all non-core visual properties as token, value pairs,
109 ** we require 2 words across the wire. In order to maintain backwards
110 ** compatibility, we need to send the total number of words that the
111 ** VisualConfigs are sent back in so old libraries can simply "ignore"
112 ** the new properties.
113 */
114 #define __GLX_TOTAL_CONFIG \
115 (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS)
116
117 extern GLint _gl_convert_from_x_visual_type(int visualType);
118
119 extern int
120 glx_config_get(struct glx_config * mode, int attribute, int *value_return);
121 extern struct glx_config *
122 glx_config_create_list(unsigned count);
123 extern void
124 glx_config_destroy_list(struct glx_config *configs);
125 extern struct glx_config *
126 glx_config_find_visual(struct glx_config *configs, int vid);
127 extern struct glx_config *
128 glx_config_find_fbconfig(struct glx_config *configs, int fbid);
129
130 #endif /* GLCONTEXTMODES_H */
131