f63fefc8f61351cbcb683a2b4f5b366c7eb3f063
[clinton/guile-figl.git] / upstream-man-pages / man2 / xhtml / glXCreateNewContext.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>glXCreateNewContext</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glXCreateNewContext"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXCreateNewContext — 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">glXCreateNewContext</b>(</code></td><td>Display *  </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXFBConfig  </td><td><var class="pdparam">config</var>, </td></tr><tr><td> </td><td>int  </td><td><var class="pdparam">render_type</var>, </td></tr><tr><td> </td><td>GLXContext  </td><td><var class="pdparam">share_list</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>config</code></em></span></dt><dd><p>
6 Specifies the GLXFBConfig structure with the desired attributes for the
7 context.
8 </p></dd><dt><span class="term"><em class="parameter"><code>render_type</code></em></span></dt><dd><p>
9 Specifies the type of the context to be created. Must be one of
10 <code class="constant">GLX_RGBA_TYPE</code> or <code class="constant">GLX_COLOR_INDEX_TYPE</code>.
11 </p></dd><dt><span class="term"><em class="parameter"><code>share_list</code></em></span></dt><dd><p>
12 Specifies the context with which to share display lists.
13 <code class="constant">NULL</code> indicates that no sharing is to take place.
14 </p></dd><dt><span class="term"><em class="parameter"><code>share_list</code></em></span></dt><dd><p>
15 Specifies whether rendering is to be done with a direct connection
16 to the graphics system if possible (<code class="constant">True</code>)
17 or through the X server (<code class="constant">False</code>).
18 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
19 <code class="function">glXCreateNewContext</code> creates a GLX rendering context and returns its handle.
20 This context can be used to render into GLX windows, pixmaps, or pixel
21 buffers.
22 If <code class="function">glXCreateNewContext</code> fails to create a rendering context,
23 <code class="constant">NULL</code> is returned.
24 </p><p>
25 If <em class="parameter"><code>render_type</code></em> is <code class="constant">GLX_RGBA_TYPE</code>, then a context that supports RGBA
26 rendering is created. If <em class="parameter"><code>config</code></em> is <code class="constant">GLX_COLOR_INDEX_TYPE</code>, then
27 context supporting color-index rendering is created.
28 </p><p>
29 If <em class="parameter"><code>render_type</code></em> is not <code class="constant">NULL</code>,
30 then all display-list indexes and definitions are shared by
31 context <em class="parameter"><code>render_type</code></em> and by the newly created context.
32 An arbitrary number of contexts can share a single display-list space.
33 However,
34 all rendering contexts that share a single display-list space must
35 themselves exist in the same address space.
36 Two rendering contexts share an address space if both are nondirect
37 using the same server,
38 or if both are direct and owned by a single process.
39 Note that in the nondirect case, it is not necessary for the calling
40 threads to share an address space,
41 only for their related rendering contexts to share an address space.
42 </p><p>
43 If <em class="parameter"><code>share_list</code></em> is <code class="constant">True</code>,
44 then a direct-rendering context is created if the
45 implementation supports direct rendering, if the connection is to an X
46 server that is local, and if a direct-rendering context is available. (An implementation may return an indirect context when <em class="parameter"><code>share_list</code></em> is <code class="constant">True</code>.)
47 If <em class="parameter"><code>share_list</code></em> is <code class="constant">False</code>,
48 then a rendering context that renders through the X server is always created.
49 Direct rendering provides a performance advantage in some implementations.
50 However, direct-rendering contexts cannot be shared outside a single process,
51 and they may be unable to render to GLX pixmaps.
52 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
53 <code class="function">glXCreateNewContext</code> is available only if the GLX version is 1.3 or greater.
54 </p><p>
55 If the GLX version is 1.1 or 1.0, the GL version must be 1.0.
56 If the GLX version is 1.2, then the GL version must be 1.1.
57 If the GLX version is 1.3, then the GL version must be 1.2.
58 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
59 <code class="constant">NULL</code> is returned if execution fails on the client side.
60 </p><p>
61 <code class="constant">GLXBadContext</code> is generated if <em class="parameter"><code>render_type</code></em> is not a GLX context
62 and is not <code class="constant">NULL</code>.
63 </p><p>
64 <code class="constant">GLXBadFBConfig</code> is generated if <em class="parameter"><code>config</code></em> is not a valid
65 GLXFBConfig.
66 </p><p>
67 <code class="constant">BadMatch</code> is generated if the context to be created would not
68 share the address space or the screen of the context specified by <em class="parameter"><code>render_type</code></em>.
69 </p><p>
70 <code class="constant">BadAlloc</code> is generated if the server does not have enough
71 resources to allocate the new context.
72 </p><p>
73 <code class="constant">BadValue</code> is generated if <em class="parameter"><code>config</code></em> is not a valid visual (for
74 example, if a particular GLX implementation does not support it).
75 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
76 <a class="citerefentry" href="glXChooseFBConfig.xml"><span class="citerefentry"><span class="refentrytitle">glXChooseFBConfig</span></span></a>,
77 <a class="citerefentry" href="glXCreateContext.xml"><span class="citerefentry"><span class="refentrytitle">glXCreateContext</span></span></a>,
78 <a class="citerefentry" href="glXDestroyContext.xml"><span class="citerefentry"><span class="refentrytitle">glXDestroyContext</span></span></a>,
79 <a class="citerefentry" href="glXGetFBConfigs.xml"><span class="citerefentry"><span class="refentrytitle">glXGetFBConfigs</span></span></a>,
80 <a class="citerefentry" href="glXGetFBConfigAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glXGetFBConfigAttrib</span></span></a>,
81 <a class="citerefentry" href="glXIsDirect.xml"><span class="citerefentry"><span class="refentrytitle">glXIsDirect</span></span></a>,
82 <a class="citerefentry" href="glXMakeContextCurrent.xml"><span class="citerefentry"><span class="refentrytitle">glXMakeContextCurrent</span></span></a>
83 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
84 Copyright <span class="trademark"></span>© 1991-2006
85 Silicon Graphics, Inc. This document is licensed under the SGI
86 Free Software B License. For details, see
87 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
88 </p></div></div></body></html>