Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glXGetConfig</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glXGetConfig"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXGetConfig — return information about GLX visuals</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">int <b class="fsfunc">glXGetConfig</b>(</code></td><td>Display * </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>XVisualInfo * </td><td><var class="pdparam">vis</var>, </td></tr><tr><td> </td><td>int </td><td><var class="pdparam">attrib</var>, </td></tr><tr><td> </td><td>int * </td><td><var class="pdparam">value</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p> | |
4 | Specifies the connection to the X server. | |
5 | </p></dd><dt><span class="term"><em class="parameter"><code>vis</code></em></span></dt><dd><p> | |
6 | Specifies the visual to be queried. | |
7 | It is a pointer to an <code class="constant">XVisualInfo</code> structure, | |
8 | not a visual ID or a pointer to a <code class="constant">Visual</code>. | |
9 | </p></dd><dt><span class="term"><em class="parameter"><code>attrib</code></em></span></dt><dd><p> | |
10 | Specifies the visual attribute to be returned. | |
11 | </p></dd><dt><span class="term"><em class="parameter"><code>value</code></em></span></dt><dd><p> | |
12 | Returns the requested value. | |
13 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
14 | <code class="function">glXGetConfig</code> sets <em class="parameter"><code>value</code></em> to the <em class="parameter"><code>attrib</code></em> value of windows or GLX pixmaps | |
15 | created with respect to <em class="parameter"><code>vis</code></em>. | |
16 | <code class="function">glXGetConfig</code> returns an error code if it fails for any reason. | |
17 | Otherwise, zero is returned. | |
18 | </p><p> | |
19 | <em class="parameter"><code>attrib</code></em> is one of the following: | |
20 | </p><p> | |
21 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GLX_USE_GL</code></span></dt><dd><p> | |
22 | <code class="constant">True</code> if OpenGL rendering is supported by this visual, | |
23 | <code class="constant">False</code> otherwise. | |
24 | </p></dd><dt><span class="term"><code class="constant">GLX_BUFFER_SIZE</code></span></dt><dd><p> | |
25 | Number of bits per color buffer. | |
26 | For RGBA visuals, <code class="constant">GLX_BUFFER_SIZE</code> is the sum of | |
27 | <code class="constant">GLX_RED_SIZE</code>, | |
28 | <code class="constant">GLX_GREEN_SIZE</code>, | |
29 | <code class="constant">GLX_BLUE_SIZE</code>, and | |
30 | <code class="constant">GLX_ALPHA_SIZE</code>. | |
31 | For color index visuals, <code class="constant">GLX_BUFFER_SIZE</code> is the size of the | |
32 | color indexes. | |
33 | </p></dd><dt><span class="term"><code class="constant">GLX_LEVEL</code></span></dt><dd><p> | |
34 | Frame buffer level of the visual. | |
35 | Level zero is the default frame buffer. | |
36 | Positive levels correspond to frame buffers that overlay the default buffer, | |
37 | and negative levels correspond to frame buffers that underlay the default | |
38 | buffer. | |
39 | </p></dd><dt><span class="term"><code class="constant">GLX_RGBA</code></span></dt><dd><p> | |
40 | <code class="constant">True</code> if color buffers store red, green, blue, and alpha values. | |
41 | <code class="constant">False</code> if they store color indexes. | |
42 | </p></dd><dt><span class="term"><code class="constant">GLX_DOUBLEBUFFER</code></span></dt><dd><p> | |
43 | <code class="constant">True</code> if color buffers exist in front/back pairs that can be swapped, | |
44 | <code class="constant">False</code> otherwise. | |
45 | </p></dd><dt><span class="term"><code class="constant">GLX_STEREO</code></span></dt><dd><p> | |
46 | <code class="constant">True</code> if color buffers exist in left/right pairs, | |
47 | <code class="constant">False</code> otherwise. | |
48 | </p></dd><dt><span class="term"><code class="constant">GLX_AUX_BUFFERS</code></span></dt><dd><p> | |
49 | Number of auxiliary color buffers that are available. | |
50 | Zero indicates that no auxiliary color buffers exist. | |
51 | </p></dd><dt><span class="term"><code class="constant">GLX_RED_SIZE</code></span></dt><dd><p> | |
52 | Number of bits of red stored in each color buffer. | |
53 | Undefined if <code class="constant">GLX_RGBA</code> is <code class="constant">False</code>. | |
54 | </p></dd><dt><span class="term"><code class="constant">GLX_GREEN_SIZE</code></span></dt><dd><p> | |
55 | Number of bits of green stored in each color buffer. | |
56 | Undefined if <code class="constant">GLX_RGBA</code> is <code class="constant">False</code>. | |
57 | </p></dd><dt><span class="term"><code class="constant">GLX_BLUE_SIZE</code></span></dt><dd><p> | |
58 | Number of bits of blue stored in each color buffer. | |
59 | Undefined if <code class="constant">GLX_RGBA</code> is <code class="constant">False</code>. | |
60 | </p></dd><dt><span class="term"><code class="constant">GLX_ALPHA_SIZE</code></span></dt><dd><p> | |
61 | Number of bits of alpha stored in each color buffer. | |
62 | Undefined if <code class="constant">GLX_RGBA</code> is <code class="constant">False</code>. | |
63 | </p></dd><dt><span class="term"><code class="constant">GLX_DEPTH_SIZE</code></span></dt><dd><p> | |
64 | Number of bits in the depth buffer. | |
65 | </p></dd><dt><span class="term"><code class="constant">GLX_STENCIL_SIZE</code></span></dt><dd><p> | |
66 | Number of bits in the stencil buffer. | |
67 | </p></dd><dt><span class="term"><code class="constant">GLX_ACCUM_RED_SIZE</code></span></dt><dd><p> | |
68 | Number of bits of red stored in the accumulation buffer. | |
69 | </p></dd><dt><span class="term"><code class="constant">GLX_ACCUM_GREEN_SIZE</code></span></dt><dd><p> | |
70 | Number of bits of green stored in the accumulation buffer. | |
71 | </p></dd><dt><span class="term"><code class="constant">GLX_ACCUM_BLUE_SIZE</code></span></dt><dd><p> | |
72 | Number of bits of blue stored in the accumulation buffer. | |
73 | </p></dd><dt><span class="term"><code class="constant">GLX_ACCUM_ALPHA_SIZE</code></span></dt><dd><p> | |
74 | Number of bits of alpha stored in the accumulation buffer. | |
75 | </p></dd></dl></div><p> | |
76 | The X protocol allows a single visual ID to be instantiated with | |
77 | different numbers of bits per pixel. | |
78 | Windows or GLX pixmaps that will be rendered with OpenGL, however, | |
79 | must be instantiated with a color buffer depth of <code class="constant">GLX_BUFFER_SIZE</code>. | |
80 | </p><p> | |
81 | Although a GLX implementation can export many visuals that support GL | |
82 | rendering, | |
83 | it must support | |
84 | at least one RGBA visual. This visual must have at | |
85 | least one color buffer, | |
86 | a stencil buffer of at least 1 bit, | |
87 | a depth buffer of at least 12 bits, | |
88 | and an accumulation buffer. | |
89 | Alpha bitplanes are optional in this visual. | |
90 | However, | |
91 | its color buffer size must be as great as that of the | |
92 | deepest <code class="constant">TrueColor</code>, <code class="constant">DirectColor</code>, | |
93 | <code class="constant">PseudoColor</code>, or <code class="constant">StaticColor</code> visual supported on level zero, | |
94 | and it must itself be made available on level zero. | |
95 | </p><p> | |
96 | In addition, if the X server exports a <code class="constant">PseudoColor</code> | |
97 | or <code class="constant">StaticColor</code> visual on framebuffer level 0, a color index | |
98 | visual is also required on that level. | |
99 | It must have | |
100 | at least one color buffer, | |
101 | a stencil buffer of at least 1 bit, | |
102 | and a depth buffer of at least 12 bits. | |
103 | This visual must | |
104 | have as many | |
105 | color bitplanes as the deepest | |
106 | <code class="constant">PseudoColor</code> or <code class="constant">StaticColor</code> visual supported on level 0. | |
107 | </p><p> | |
108 | Applications are best written to select the visual that most closely | |
109 | meets their requirements. | |
110 | Creating windows or GLX pixmaps with unnecessary buffers can result in | |
111 | reduced rendering performance as well as poor resource allocation. | |
112 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
113 | <code class="constant">XVisualInfo</code> is defined in <span class="emphasis"><em>Xutil.h.</em></span> | |
114 | It is a structure that includes <span class="emphasis"><em>visual</em></span>, <span class="emphasis"><em>visualID</em></span>, <span class="emphasis"><em>screen</em></span>, and | |
115 | <span class="emphasis"><em>depth</em></span> elements. | |
116 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
117 | <code class="constant">GLX_NO_EXTENSION</code> is returned if <em class="parameter"><code>dpy</code></em> does not support the GLX | |
118 | extension. | |
119 | </p><p> | |
120 | <code class="constant">GLX_BAD_SCREEN</code> is returned if the screen of <em class="parameter"><code>vis</code></em> does not correspond | |
121 | to a screen. | |
122 | </p><p> | |
123 | <code class="constant">GLX_BAD_ATTRIBUTE</code> is returned if <em class="parameter"><code>attrib</code></em> is not a valid GLX attribute. | |
124 | </p><p> | |
125 | <code class="constant">GLX_BAD_VISUAL</code> is returned if <em class="parameter"><code>vis</code></em> doesn't support GLX and an | |
126 | attribute other than <code class="constant">GLX_USE_GL</code> is requested. | |
127 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
128 | <a class="citerefentry" href="glXChooseVisual.xml"><span class="citerefentry"><span class="refentrytitle">glXChooseVisual</span></span></a>, | |
129 | <a class="citerefentry" href="glXCreateContext.xml"><span class="citerefentry"><span class="refentrytitle">glXCreateContext</span></span></a> | |
130 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
131 | Copyright <span class="trademark"></span>© 1991-2006 | |
132 | Silicon Graphics, Inc. This document is licensed under the SGI | |
133 | Free Software B License. For details, see | |
134 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
135 | </p></div></div></body></html> |