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