740563ead22c76dcf8a9c63ac4cc3b5546e0b5c3
[clinton/guile-figl.git] / upstream-man-pages / man2 / xhtml / glXCreateContext.xml
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>glXCreateContext</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glXCreateContext"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXCreateContext — create a new GLX rendering context</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">GLXContext <b class="fsfunc">glXCreateContext</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>GLXContext  </td><td><var class="pdparam">shareList</var>, </td></tr><tr><td> </td><td>Bool  </td><td><var class="pdparam">direct</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 that defines the frame buffer resources available to
7 the rendering context.
8 It is a pointer to an <code class="constant">XVisualInfo</code> structure,
9 not a visual ID or a pointer to a <code class="constant">Visual</code>.
10 </p></dd><dt><span class="term"><em class="parameter"><code>shareList</code></em></span></dt><dd><p>
11 Specifies the context with which to share display lists.
12 <code class="constant">NULL</code> indicates that no sharing is to take place.
13 </p></dd><dt><span class="term"><em class="parameter"><code>direct</code></em></span></dt><dd><p>
14 Specifies whether rendering is to be done with a direct connection
15 to the graphics system if possible (<code class="constant">True</code>)
16 or through the X server (<code class="constant">False</code>).
17 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
18 <code class="function">glXCreateContext</code> creates a GLX rendering context and returns its handle.
19 This context can be used to render into both windows and GLX pixmaps.
20 If <code class="function">glXCreateContext</code> fails to create a rendering context,
21 <code class="constant">NULL</code> is returned.
22 </p><p>
23 If <em class="parameter"><code>direct</code></em> is <code class="constant">True</code>,
24 then a direct rendering context is created if the
25 implementation supports direct rendering, if the connection is to an X
26 server that is local, and if a direct rendering context is available. (An implementation may return an indirect context when <em class="parameter"><code>direct</code></em> is <code class="constant">True</code>.)
27 If <em class="parameter"><code>direct</code></em> is <code class="constant">False</code>,
28 then a rendering context that renders through the X server is always created.
29 Direct rendering provides a performance advantage in some implementations.
30 However, direct rendering contexts cannot be shared outside a single process,
31 and they may be unable to render to GLX pixmaps.
32 </p><p>
33 If <em class="parameter"><code>shareList</code></em> is not <code class="constant">NULL</code>,
34 then all display-list indexes and definitions are shared by
35 context <em class="parameter"><code>shareList</code></em> and by the newly created context.
36 An arbitrary number of contexts can share a single display-list space.
37 However,
38 all rendering contexts that share a single display-list space must
39 themselves exist in the same address space.
40 Two rendering contexts share an address space if both are nondirect
41 using the same server,
42 or if both are direct and owned by a single process.
43 Note that in the nondirect case, it is not necessary for the calling
44 threads to share an address space,
45 only for their related rendering contexts to share an address space.
46 </p><p>
47 If the GL version is 1.1 or greater,
48 then all texture objects except object 0
49 are shared by any contexts that share display lists.
50 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
51 <code class="constant">XVisualInfo</code> is defined in <span class="emphasis"><em>Xutil.h.</em></span>
52 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
53 <span class="emphasis"><em>depth</em></span> elements.
54 </p><p>
55 A <span class="emphasis"><em>process</em></span> is a single execution environment,
56 implemented in a single address space,
57 consisting of one or more threads.
58 </p><p>
59 A <span class="emphasis"><em>thread</em></span> is one of a set of subprocesses that share
60 a single address space,
61 but maintain separate program counters,
62 stack spaces,
63 and other related global data.
64 A <span class="emphasis"><em>thread</em></span> that is the only member of its subprocess group
65 is equivalent to a <span class="emphasis"><em>process</em></span>.
66 </p><p>
67 It may not be possible to render to a GLX pixmap with a direct rendering
68 context.
69 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
70 <code class="constant">NULL</code> is returned if execution fails on the client side.
71 </p><p>
72 <code class="constant">BadMatch</code> is generated if the context to be created would not
73 share the address space or the screen of the context specified by <em class="parameter"><code>shareList</code></em>.
74 </p><p>
75 <code class="constant">BadValue</code> is generated if <em class="parameter"><code>vis</code></em> is not a valid visual (for
76 example, if a particular GLX implementation does not support it).
77 </p><p>
78 <code class="constant">GLXBadContext</code> is generated if <em class="parameter"><code>shareList</code></em> is not a GLX context
79 and is not <code class="constant">NULL</code>.
80 </p><p>
81 <code class="constant">BadAlloc</code> is generated if the server does not have enough
82 resources to allocate the new context.
83 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
84 <a class="citerefentry" href="glXDestroyContext.xml"><span class="citerefentry"><span class="refentrytitle">glXDestroyContext</span></span></a>,
85 <a class="citerefentry" href="glXGetConfig.xml"><span class="citerefentry"><span class="refentrytitle">glXGetConfig</span></span></a>,
86 <a class="citerefentry" href="glXIsDirect.xml"><span class="citerefentry"><span class="refentrytitle">glXIsDirect</span></span></a>,
87 <a class="citerefentry" href="glXMakeCurrent.xml"><span class="citerefentry"><span class="refentrytitle">glXMakeCurrent</span></span></a>
88 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
89 Copyright <span class="trademark"></span>© 1991-2006
90 Silicon Graphics, Inc. This document is licensed under the SGI
91 Free Software B License. For details, see
92 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
93 </p></div></div></body></html>