1Name 2 3 EXT_visual_info 4 5Name Strings 6 7 GLX_EXT_visual_info 8 9Version 10 11 $Date: 1995/10/06 00:47:08 $ $Revision: 1.14 $ 12 13Number 14 15 28 16 17Dependencies 18 19 SGIS_multisample affects the definition of this extension 20 21Overview 22 23 This extension allows the user to request a particular X visual 24 type to be associated with a GLX visual, and allows the user 25 to query the X visual type underlying a GLX visual. 26 27 In addition, this extension provides a means to request a visual 28 with a transparent pixel and to query whether a visual supports a 29 transparent pixel value and the value of the transparent pixel. 30 Note that the notion of level and transparent pixels are orthogonal as 31 both layer 1 and layer 0 visuals may or may not have a transparent pixel 32 value. 33 34Issues 35 The X server allows two types of transparency: pixel and mask. 36 For mask, any pixel matching the transparency mask is transparent. 37 Do we want to include masks? GLX_TRANSPARENT_PIXEL has been changed 38 from a boolean to an enum to allow for this possibility. 39 40 Alpha is no longer included in the transparent pixel, although it 41 may be useful in the future. Thus, we allow the TRANSPARENT_ALPHA_VALUE 42 to be queried -- even though it is not used. In the future 43 a GLX_TRANSPARENT_ALPHA or GLX_TRANSPARENT_RGBA transparency 44 mode could be added. 45 46 Keep tokens for GRAY_SCALE and STATIC_GRAY for future use, even 47 though they don't match visuals now. 48 49 Should glXChooseVisual ignore GLX_TRANSPARENT_INDEX_VALUE_EXT, 50 GLX_TRANSPARENT_RED_VALUE_EXT, GLX_TRANSPARENT_GREEN_VALUE_EXT, 51 GLX_TRANSPARENT_BLUE_VALUE_EXT, and GLX_TRANSPARENT_ALPHA_VALUE_EXT 52 settings in attrib_list if GLX_TRANSPARENT_TYPE_EXT is not set (either 53 explicitly or implicitly) to a value other than GLX_NONE_EXT? Maybe it 54 should just match the requested attributes -- even if the request doesn't 55 make sense. 56 57New Procedures and Functions 58 59 None 60 61New Tokens 62 63 Accepted by the <attrib> parameter of glXGetConfig, and by the 64 <attrib_list> parameter of glXChooseVisual: 65 66 GLX_X_VISUAL_TYPE_EXT 0x22 67 GLX_TRANSPARENT_TYPE_EXT 0x23 68 GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 69 GLX_TRANSPARENT_RED_VALUE_EXT 0x25 70 GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 71 GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 72 GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 73 74 Returned by glXGetConfig, and accepted by the <attrib_list> 75 parameter of glXChooseVisual (following the GLX_X_VISUAL_TYPE_EXT 76 token): 77 78 GLX_TRUE_COLOR_EXT 0x8002 79 GLX_DIRECT_COLOR_EXT 0x8003 80 GLX_PSEUDO_COLOR_EXT 0x8004 81 GLX_STATIC_COLOR_EXT 0x8005 82 GLX_GRAY_SCALE_EXT 0x8006 83 GLX_STATIC_GRAY_EXT 0x8007 84 85 Returned by glXGetConfig, and accepted by the <attrib_list> 86 parameter of glXChooseVisual (following the GLX_TRANSPARENT_TYPE_EXT 87 token): 88 89 GLX_NONE_EXT 0x8000 90 GLX_TRANSPARENT_RGB_EXT 0x8008 91 GLX_TRANSPARENT_INDEX_EXT 0x8009 92 93Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 94 95 None 96 97Additions to Chapter 3 of the 1.0 Specification (Rasterization) 98 99 None 100 101Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations and 102the Framebuffer) 103 104 105Additions to Chapter 5 of the 1.0 Specification (Special Functions) 106 107 None 108 109Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 110 111 None 112 113Additions to the GLX Specification 114 115 The X visual type of a GLX visual can be queried using glXGetConfig(). 116 117 The visual attribute GLX_TRANSPARENT_TYPE_EXT indicates whether or not 118 the visual supports transparency, and if it does support transparency, 119 what type of transparency is available. If the attribute is set to 120 GLX_NONE_EXT then windows created with the visual will not have any 121 transparent pixels. If the attribute is GLX_TRANSPARENT_RGB_EXT or 122 GLX_TRANSPARENT_INDEX_EXT then the visual supports transparency. 123 GLX_TRANSPARENT_RGB_EXT is only applicable to TrueColor and DirectColor 124 visuals: a transparent pixel will be drawn when the red, green and blue 125 values which are read from the framebuffer are equal to 126 GLX_TRANSPARENT_RED_VALUE_EXT, GLX_TRANSPARENT_GREEN_VALUE_EXT and 127 GLX_TRANSPARENT_BLUE_VALUE_EXT, respectively. For PseudoColor and 128 StaticColor the transparency mode GLX_TRANSPARENT_INDEX_EXT is used. 129 In this case, a transparent pixel will be drawn when the index value that 130 is read from the framebuffer is equal to GLX_TRANSPARENT_INDEX_VALUE_EXT. 131 132 If GLX_TRANSPARENT_TYPE_EXT is GLX_NONE_EXT or GLX_TRANSPARENT_RGB_EXT, 133 then the value returned for GLX_TRANSPARENT_INDEX_VALUE_EXT is undefined. 134 If GLX_TRANSPARENT_TYPE_EXT is GLX_NONE_EXT or GLX_TRANSPARENT_INDEX_EXT, 135 then the values returned for GLX_TRANSPARENT_RED_VALUE_EXT, 136 GLX_TRANSPARENT_GREEN_VALUE_EXT, and GLX_TRANSPARENT_BLUE_VALUE_EXT are 137 undefined. When defined, GLX_TRANSPARENT_RED_VALUE_EXT, 138 GLX_TRANSPARENT_GREEN_VALUE_EXT, and GLX_TRANSPARENT_BLUE_VALUE_EXT are 139 integer framebuffer values between 0 and the maximum framebuffer value for 140 the component. For example, GLX_TRANSPARENT_RED_VALUE_EXT will range 141 between 0 and (2**GLX_RED_SIZE)-1. (GLX_TRANSPARENT_ALPHA_VALUE_EXT is 142 for future use.) 143 144 Attribute Type Notes 145 --------- ---- ----- 146 GLX_USE_GL boolean True if OpenGL rendering is supported 147 GLX_BUFFER_SIZE integer depth of the color buffer 148 GLX_LEVEL integer frame buffer level 149 GLX_RGBA boolean True if in RGBA rendering is supported 150 GLX_DOUBLEBUFFER boolean True if color buffers have front/back pairs 151 GLX_STEREO boolean True if color buffers have left/right pairs 152 GLX_AUX_BUFFERS integer number of auxiliary color buffers 153 GLX_RED_SIZE integer number of bits of Red in the framebuffer 154 GLX_GREEN_SIZE integer number of bits of Green in the framebuffer 155 GLX_BLUE_SIZE integer number of bits of Blue in the framebuffer 156 GLX_ALPHA_SIZE integer number of bits of Alpha in the framebuffer 157 GLX_DEPTH_SIZE integer number of bits in the depth buffer 158 GLX_STENCIL_SIZE integer number of bits in the stencil buffer 159 GLX_ACCUM_RED_SIZE integer number of bits of Red in the accumulation buffer 160 GLX_ACCUM_GREEN_SIZE integer number of bits of Green in the accumulation buffer 161 GLX_ACCUM_BLUE_SIZE integer number of bits of Blue in the accumulation buffer 162 GLX_ACCUM_ALPHA_SIZE integer number of bits of Alpha in the accumulation buffer 163 GLX_SAMPLE_BUFFERS_SGIS integer number of multisample buffers 164 GLX_SAMPLES_SGIS integer number of samples stored in each multisample buffer 165 GLX_X_VISUAL_TYPE_EXT integer X visual type of the GLX visual 166 GLX_TRANSPARENT_TYPE_EXT enum None, TRANSPARENT_RGB_EXT, or TRANSPARENT_INDEX_EXT 167 GLX_TRANSPARENT_INDEX_VALUE_EXT integer transparent index value. 168 GLX_TRANSPARENT_RED_VALUE_EXT integer transparent red value. 169 GLX_TRANSPARENT_GREEN_VALUE_EXT integer transparent green value. 170 GLX_TRANSPARENT_BLUE_VALUE_EXT integer transparent blue value. 171 GLX_TRANSPARENT_ALPHA_VALUE_EXT integer transparent alpha value. 172 173 Table 1: Configuration attributes 174 175 glXGetConfig returns one of the values in table 2 (below) when called 176 with attribute name GLX_X_VISUAL_TYPE_EXT. 177 178 GLX token name X Visual Type 179 -------------- ------------- 180 GLX_TRUE_COLOR_EXT TrueColor 181 GLX_DIRECT_COLOR_EXT DirectColor 182 GLX_PSEUDO_COLOR_EXT PseudoColor 183 GLX_STATIC_COLOR_EXT StaticColor 184 GLX_GRAY_SCALE_EXT GrayScale 185 GLX_STATIC_GRAY_EXT StaticGray 186 187 Table 2: X visual type token values 188 189 Replace the GLX specification discussion of glXChooseVisual with 190 the following text: 191 192 glXChooseVisual is used to find a visual that matches the client's 193 specified attributes. 194 195 XVisualInfo* glXChooseVisual( Display *dpy, int screen, 196 int *attrib_list ); 197 198 glXChooseVisual returns a pointer to an XVisualInfo structure 199 describing the visual that best meets a minimum specification. The 200 boolean GLX attributes of the visual that is returned will match the 201 specification exactly. The integer GLX attributes will meet or exceed 202 the specified minimum values. The enumerated GLX attributes are 203 matched in an attribute-specific manner. If no conforming visual 204 exists, NULL is returned. 205 206 The enumerated attribute GLX_X_VISUAL_TYPE_EXT specifies which X 207 visual type is required for the requested GLX visual. 208 209 If GLX_RGBA is in <attrib_list>, then only GLX_TRUE_COLOR_EXT and 210 GLX_DIRECT_COLOR_EXT can produce a match. If GLX_X_VISUAL_TYPE_EXT 211 is not in <attrib_list>, and if all other attributes are equivalent, 212 then a TrueColor visual will be chosen in preference to a DirectColor 213 visual. 214 215 If GLX_RGBA is not in <attrib_list>, then only GLX_PSEUDO_COLOR_EXT and 216 GLX_STATIC_COLOR_EXT can produce a match. If GLX_X_VISUAL_TYPE_EXT 217 is not in <attrib_list>, and if all other attributes are equivalent, 218 then a PseudoColor visual will be chosen in preference to a StaticColor 219 visual. 220 221 The tokens GLX_GRAY_SCALE_EXT and GLX_STATIC_GRAY_EXT will not match 222 current OpenGL enabled visuals, but are included for future use. 223 224 If GLX_TRANSPARENT_TYPE_EXT is not included in <attrib_list>, 225 then the attribute will be treated as a "don't care" and a 226 visual with or without a transparent pixel may be chosen. 227 If GLX_TRANSPARENT_TYPE_EXT is not included in <attrib_list>, or if it 228 is set to GLX_NONE_EXT, then inclusion of GLX_TRANSPARENT_INDEX_VALUE_EXT, 229 GLX_TRANSPARENT_RED_VALUE_EXT, GLX_TRANSPARENT_GREEN_VALUE_EXT, 230 GLX_TRANSPARENT_BLUE_VALUE_EXT, or GLX_TRANSPARENT_ALPHA_VALUE_EXT 231 will be ignored. 232 233 All boolean GLX attributes default to False except GLX_USE_GL, which 234 defaults to True. All integer attributes default to zero. 235 236 Default specifications are superseded by the attributes included in 237 <attrib_list>. Integer attributes are immediately followed by the 238 corresponding desired value. Boolean attributes appearing in 239 <attrib_list> have an implicit True value; such attributes are never 240 followed by an explicit True or False value. The list is terminated 241 with None. 242 243 To free the data returned, use XFree(). 244 245 NULL is returned if an undefined GLX attribute is encountered, or 246 if an unacceptable enumerated attribute value is encountered. 247 248GLX Protocol 249 250 Seven new property type/property value pairs are included in the property 251 list of each visual returned by glXGetVisualConfigs. The property 252 type/property value pairs are encoded as 253 254 4 ENUM property type 255 0x22 GLX_X_VISUAL_TYPE_EXT 256 4 ENUM property value 257 0x8002 GLX_TRUE_COLOR_EXT 258 0x8003 GLX_DIRECT_COLOR_EXT 259 0x8004 GLX_PSEUDO_COLOR_EXT 260 0x8005 GLX_STATIC_COLOR_EXT 261 0x8006 GLX_GRAY_SCALE_EXT 262 0x8007 GLX_STATIC_GRAY_EXT 263 264 4 ENUM property type 265 0x23 GLX_TRANSPARENT_TYPE_EXT 266 4 ENUM property value 267 0x8000 GLX_NONE_EXT 268 0x8008 GLX_TRANSPARENT_RGB_EXT 269 0x8009 GLX_TRANSPARENT_INDEX_EXT 270 271 4 ENUM property type 272 0x24 GLX_TRANSPARENT_INDEX_VALUE_EXT 273 4 BOOL32 property value 274 275 4 ENUM property type 276 0x25 GLX_TRANSPARENT_RED_VALUE_EXT 277 4 INT32 property value 278 279 4 ENUM property type 280 0x26 GLX_TRANSPARENT_GREEN_VALUE_EXT 281 4 INT32 property value 282 283 4 ENUM property type 284 0x27 GLX_TRANSPARENT_BLUE_VALUE_EXT 285 4 INT32 property value 286 287 4 ENUM property type 288 0x28 GLX_TRANSPARENT_ALPHA_VALUE_EXT 289 4 INT32 property value 290 291 292Dependencies on SGIS_multisample 293 294 If SGIS_multisample is not supported, references to 295 GLX_SAMPLE_BUFFERS_SGIS and GLX_SAMPLES_SGIS in this document are 296 invalid and should be ignored. 297 298Errors 299 300 None 301 302New State 303 304 None 305 306New Implementation Dependent State 307 308 Get Value Get Command Type 309 --------- ----------- ---- 310 GLX_X_VISUAL_TYPE_EXT glXGetConfig Z6 311 GLX_TRANSPARENT_TYPE_EXT glXGetConfig 312 GLX_TRANSPARENT_INDEX_VALUE_EXT glXGetConfig 313 GLX_TRANSPARENT_RED_VALUE_EXT glXGetConfig 314 GLX_TRANSPARENT_GREEN_VALUE_EXT glXGetConfig 315 GLX_TRANSPARENT_BLUE_VALUE_EXT glXGetConfig 316 GLX_TRANSPARENT_ALPHA_VALUE_EXT glXGetConfig 317