| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" |
| 3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> |
| 4 | <refentry id="glXCreateNewContext"> |
| 5 | <refmeta> |
| 6 | <refmetainfo> |
| 7 | <copyright> |
| 8 | <year>1991-2006</year> |
| 9 | <holder>Silicon Graphics, Inc.</holder> |
| 10 | </copyright> |
| 11 | </refmetainfo> |
| 12 | <refentrytitle>glXCreateNewContext</refentrytitle> |
| 13 | <manvolnum>3G</manvolnum> |
| 14 | </refmeta> |
| 15 | <refnamediv> |
| 16 | <refname>glXCreateNewContext</refname> |
| 17 | <refpurpose>create a new GLX rendering context</refpurpose> |
| 18 | </refnamediv> |
| 19 | <refsynopsisdiv><title>C Specification</title> |
| 20 | <funcsynopsis> |
| 21 | <funcprototype> |
| 22 | <funcdef>GLXContext <function>glXCreateNewContext</function></funcdef> |
| 23 | <paramdef>Display * <parameter>dpy</parameter></paramdef> |
| 24 | <paramdef>GLXFBConfig <parameter>config</parameter></paramdef> |
| 25 | <paramdef>int <parameter>render_type</parameter></paramdef> |
| 26 | <paramdef>GLXContext <parameter>share_list</parameter></paramdef> |
| 27 | <paramdef>Bool <parameter>direct</parameter></paramdef> |
| 28 | </funcprototype> |
| 29 | </funcsynopsis> |
| 30 | </refsynopsisdiv> |
| 31 | <!-- eqn: ignoring delim $$ --> |
| 32 | <refsect1 id="parameters"><title>Parameters</title> |
| 33 | <variablelist> |
| 34 | <varlistentry> |
| 35 | <term><parameter>dpy</parameter></term> |
| 36 | <listitem> |
| 37 | <para> |
| 38 | Specifies the connection to the X server. |
| 39 | </para> |
| 40 | </listitem> |
| 41 | </varlistentry> |
| 42 | <varlistentry> |
| 43 | <term><parameter>config</parameter></term> |
| 44 | <listitem> |
| 45 | <para> |
| 46 | Specifies the GLXFBConfig structure with the desired attributes for the |
| 47 | context. |
| 48 | </para> |
| 49 | </listitem> |
| 50 | </varlistentry> |
| 51 | <varlistentry> |
| 52 | <term><parameter>render_type</parameter></term> |
| 53 | <listitem> |
| 54 | <para> |
| 55 | Specifies the type of the context to be created. Must be one of |
| 56 | <constant>GLX_RGBA_TYPE</constant> or <constant>GLX_COLOR_INDEX_TYPE</constant>. |
| 57 | </para> |
| 58 | </listitem> |
| 59 | </varlistentry> |
| 60 | <varlistentry> |
| 61 | <term><parameter>share_list</parameter></term> |
| 62 | <listitem> |
| 63 | <para> |
| 64 | Specifies the context with which to share display lists. |
| 65 | <constant>NULL</constant> indicates that no sharing is to take place. |
| 66 | </para> |
| 67 | </listitem> |
| 68 | </varlistentry> |
| 69 | <varlistentry> |
| 70 | <term><parameter>share_list</parameter></term> |
| 71 | <listitem> |
| 72 | <para> |
| 73 | Specifies whether rendering is to be done with a direct connection |
| 74 | to the graphics system if possible (<constant>True</constant>) |
| 75 | or through the X server (<constant>False</constant>). |
| 76 | </para> |
| 77 | </listitem> |
| 78 | </varlistentry> |
| 79 | </variablelist> |
| 80 | </refsect1> |
| 81 | <refsect1 id="description"><title>Description</title> |
| 82 | <para> |
| 83 | <function>glXCreateNewContext</function> creates a GLX rendering context and returns its handle. |
| 84 | This context can be used to render into GLX windows, pixmaps, or pixel |
| 85 | buffers. |
| 86 | If <function>glXCreateNewContext</function> fails to create a rendering context, |
| 87 | <constant>NULL</constant> is returned. |
| 88 | </para> |
| 89 | <para> |
| 90 | If <parameter>render_type</parameter> is <constant>GLX_RGBA_TYPE</constant>, then a context that supports RGBA |
| 91 | rendering is created. If <parameter>config</parameter> is <constant>GLX_COLOR_INDEX_TYPE</constant>, then |
| 92 | context supporting color-index rendering is created. |
| 93 | </para> |
| 94 | <para> |
| 95 | If <parameter>render_type</parameter> is not <constant>NULL</constant>, |
| 96 | then all display-list indexes and definitions are shared by |
| 97 | context <parameter>render_type</parameter> and by the newly created context. |
| 98 | An arbitrary number of contexts can share a single display-list space. |
| 99 | However, |
| 100 | all rendering contexts that share a single display-list space must |
| 101 | themselves exist in the same address space. |
| 102 | Two rendering contexts share an address space if both are nondirect |
| 103 | using the same server, |
| 104 | or if both are direct and owned by a single process. |
| 105 | Note that in the nondirect case, it is not necessary for the calling |
| 106 | threads to share an address space, |
| 107 | only for their related rendering contexts to share an address space. |
| 108 | </para> |
| 109 | <para> |
| 110 | If <parameter>share_list</parameter> is <constant>True</constant>, |
| 111 | then a direct-rendering context is created if the |
| 112 | implementation supports direct rendering, if the connection is to an X |
| 113 | server that is local, and if a direct-rendering context is available. (An implementation may return an indirect context when <parameter>share_list</parameter> is <constant>True</constant>.) |
| 114 | If <parameter>share_list</parameter> is <constant>False</constant>, |
| 115 | then a rendering context that renders through the X server is always created. |
| 116 | Direct rendering provides a performance advantage in some implementations. |
| 117 | However, direct-rendering contexts cannot be shared outside a single process, |
| 118 | and they may be unable to render to GLX pixmaps. |
| 119 | </para> |
| 120 | </refsect1> |
| 121 | <refsect1 id="notes"><title>Notes</title> |
| 122 | <para> |
| 123 | <function>glXCreateNewContext</function> is available only if the GLX version is 1.3 or greater. |
| 124 | </para> |
| 125 | <para> |
| 126 | If the GLX version is 1.1 or 1.0, the GL version must be 1.0. |
| 127 | If the GLX version is 1.2, then the GL version must be 1.1. |
| 128 | If the GLX version is 1.3, then the GL version must be 1.2. |
| 129 | </para> |
| 130 | </refsect1> |
| 131 | <refsect1 id="errors"><title>Errors</title> |
| 132 | <para> |
| 133 | <constant>NULL</constant> is returned if execution fails on the client side. |
| 134 | </para> |
| 135 | <para> |
| 136 | <constant>GLXBadContext</constant> is generated if <parameter>render_type</parameter> is not a GLX context |
| 137 | and is not <constant>NULL</constant>. |
| 138 | </para> |
| 139 | <para> |
| 140 | <constant>GLXBadFBConfig</constant> is generated if <parameter>config</parameter> is not a valid |
| 141 | GLXFBConfig. |
| 142 | </para> |
| 143 | <para> |
| 144 | <constant>BadMatch</constant> is generated if the context to be created would not |
| 145 | share the address space or the screen of the context specified by <parameter>render_type</parameter>. |
| 146 | </para> |
| 147 | <para> |
| 148 | <constant>BadAlloc</constant> is generated if the server does not have enough |
| 149 | resources to allocate the new context. |
| 150 | </para> |
| 151 | <para> |
| 152 | <constant>BadValue</constant> is generated if <parameter>config</parameter> is not a valid visual (for |
| 153 | example, if a particular GLX implementation does not support it). |
| 154 | </para> |
| 155 | </refsect1> |
| 156 | <refsect1 id="seealso"><title>See Also</title> |
| 157 | <para> |
| 158 | <citerefentry><refentrytitle>glXChooseFBConfig</refentrytitle></citerefentry>, |
| 159 | <citerefentry><refentrytitle>glXCreateContext</refentrytitle></citerefentry>, |
| 160 | <citerefentry><refentrytitle>glXDestroyContext</refentrytitle></citerefentry>, |
| 161 | <citerefentry><refentrytitle>glXGetFBConfigs</refentrytitle></citerefentry>, |
| 162 | <citerefentry><refentrytitle>glXGetFBConfigAttrib</refentrytitle></citerefentry>, |
| 163 | <citerefentry><refentrytitle>glXIsDirect</refentrytitle></citerefentry>, |
| 164 | <citerefentry><refentrytitle>glXMakeContextCurrent</refentrytitle></citerefentry> |
| 165 | </para> |
| 166 | </refsect1> |
| 167 | <refsect1 id="Copyright"><title>Copyright</title> |
| 168 | <para> |
| 169 | Copyright <trademark class="copyright"></trademark> 1991-2006 |
| 170 | Silicon Graphics, Inc. This document is licensed under the SGI |
| 171 | Free Software B License. For details, see |
| 172 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. |
| 173 | </para> |
| 174 | </refsect1> |
| 175 | </refentry> |