2 * (C) Copyright IBM Corporation 2003
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:
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
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.
26 * \file glcontextmodes.h
27 * \author Ian Romanick <idr@us.ibm.com>
30 #ifndef GLCONTEXTMODES_H
31 #define GLCONTEXTMODES_H
33 typedef struct __GLcontextModesRec
{
34 struct __GLcontextModesRec
* next
;
38 GLboolean colorIndexMode
;
39 GLuint doubleBufferMode
;
42 GLboolean haveAccumBuffer
;
43 GLboolean haveDepthBuffer
;
44 GLboolean haveStencilBuffer
;
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 */
51 GLint accumRedBits
, accumGreenBits
, accumBlueBits
, accumAlphaBits
;
63 GLint visualType
; /**< One of the GLX X visual types. (i.e.,
64 * \c GLX_TRUE_COLOR, etc.)
67 /* EXT_visual_rating / GLX 1.2 */
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
;
76 /* ARB_multisample / SGIS_multisample */
80 /* SGIX_fbconfig / GLX 1.3 */
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. */
93 /* SGIX_visual_select_group */
94 GLint visualSelectGroup
;
101 /* EXT_texture_from_pixmap */
102 GLint bindToTextureRgb
;
103 GLint bindToTextureRgba
;
104 GLint bindToMipmapTexture
;
105 GLint bindToTextureTargets
;
109 #define __GLX_MIN_CONFIG_PROPS 18
110 #define __GLX_MAX_CONFIG_PROPS 500
111 #define __GLX_EXT_CONFIG_PROPS 10
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.
120 #define __GLX_TOTAL_CONFIG \
121 (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS)
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
);
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
*
133 extern __GLcontextModes
*_gl_context_modes_find_fbconfig(__GLcontextModes
*
135 extern GLboolean
_gl_context_modes_are_same(const __GLcontextModes
* a
,
136 const __GLcontextModes
* b
);
138 #endif /* GLCONTEXTMODES_H */