<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?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>
                    Specifies the connection to the X server.
                </p></dd><dt><span class="term"><em class="parameter"><code>config</code></em></span></dt><dd><p>
                    Specifies the GLXFBConfig structure with the desired attributes for the
                    context.
                </p></dd><dt><span class="term"><em class="parameter"><code>render_type</code></em></span></dt><dd><p>
                    Specifies the type of the context to be created.  Must be one of
                    <code class="constant">GLX_RGBA_TYPE</code> or <code class="constant">GLX_COLOR_INDEX_TYPE</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>share_list</code></em></span></dt><dd><p>
                    Specifies the context with which to share display lists.
                    <code class="constant">NULL</code> indicates that no sharing is to take place.
                </p></dd><dt><span class="term"><em class="parameter"><code>share_list</code></em></span></dt><dd><p>
                    Specifies whether rendering is to be done with a direct connection
                    to the graphics system if possible (<code class="constant">True</code>)
                    or through the X server (<code class="constant">False</code>).
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glXCreateNewContext</code> creates a GLX rendering context and returns its handle.
            This context can be used to render into GLX windows, pixmaps, or pixel 
            buffers.
            If <code class="function">glXCreateNewContext</code> fails to create a rendering context,
            <code class="constant">NULL</code> is returned.
        </p><p>
            If <em class="parameter"><code>render_type</code></em> is <code class="constant">GLX_RGBA_TYPE</code>, then a context that supports RGBA
            rendering is created.  If <em class="parameter"><code>config</code></em> is <code class="constant">GLX_COLOR_INDEX_TYPE</code>, then
            context supporting color-index rendering is created.
        </p><p>
            If <em class="parameter"><code>render_type</code></em> is not <code class="constant">NULL</code>,
            then all display-list indexes and definitions are shared by
            context <em class="parameter"><code>render_type</code></em> and by the newly created context.
            An arbitrary number of contexts can share a single display-list space.
            However,
            all rendering contexts that share a single display-list space must
            themselves exist in the same address space.
            Two rendering contexts share an address space if both are nondirect
            using the same server,
            or if both are direct and owned by a single process.
            Note that in the nondirect case, it is not necessary for the calling
            threads to share an address space,
            only for their related rendering contexts to share an address space.
        </p><p>
            If <em class="parameter"><code>share_list</code></em> is <code class="constant">True</code>,
            then a direct-rendering context is created if the
            implementation supports direct rendering, if the connection is to an X
            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>.)
            If <em class="parameter"><code>share_list</code></em> is <code class="constant">False</code>,
            then a rendering context that renders through the X server is always created.
            Direct rendering provides a performance advantage in some implementations.
            However, direct-rendering contexts cannot be shared outside a single process,
            and they may be unable to render to GLX pixmaps.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glXCreateNewContext</code> is available only if the GLX version is 1.3 or greater.
        </p><p>
            If the GLX version is 1.1 or 1.0, the GL version must be 1.0.
            If the GLX version is 1.2, then the GL version must be 1.1.
            If the GLX version is 1.3, then the GL version must be 1.2.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">NULL</code> is returned if execution fails on the client side.
        </p><p>
            <code class="constant">GLXBadContext</code> is generated if <em class="parameter"><code>render_type</code></em> is not a GLX context
            and is not <code class="constant">NULL</code>.
        </p><p>
            <code class="constant">GLXBadFBConfig</code> is generated if <em class="parameter"><code>config</code></em> is not a valid
            GLXFBConfig.
        </p><p>
            <code class="constant">BadMatch</code> is generated if the context to be created would not
            share the address space or the screen of the context specified by <em class="parameter"><code>render_type</code></em>.
        </p><p>
            <code class="constant">BadAlloc</code> is generated if the server does not have enough
            resources to allocate the new context.
        </p><p>
            <code class="constant">BadValue</code> is generated if <em class="parameter"><code>config</code></em> is not a valid visual (for
            example, if a particular GLX implementation does not support it).
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glXChooseFBConfig.xml"><span class="citerefentry"><span class="refentrytitle">glXChooseFBConfig</span></span></a>,
            <a class="citerefentry" href="glXCreateContext.xml"><span class="citerefentry"><span class="refentrytitle">glXCreateContext</span></span></a>,
            <a class="citerefentry" href="glXDestroyContext.xml"><span class="citerefentry"><span class="refentrytitle">glXDestroyContext</span></span></a>,
            <a class="citerefentry" href="glXGetFBConfigs.xml"><span class="citerefentry"><span class="refentrytitle">glXGetFBConfigs</span></span></a>,
            <a class="citerefentry" href="glXGetFBConfigAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glXGetFBConfigAttrib</span></span></a>,
            <a class="citerefentry" href="glXIsDirect.xml"><span class="citerefentry"><span class="refentrytitle">glXIsDirect</span></span></a>,
            <a class="citerefentry" href="glXMakeContextCurrent.xml"><span class="citerefentry"><span class="refentrytitle">glXMakeContextCurrent</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>
