Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1452 | chris | 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="glXCreateContext"> |
||
| 5 | <refmeta> |
||
| 6 | <refmetainfo> |
||
| 7 | <copyright> |
||
| 8 | <year>1991-2006</year> |
||
| 9 | <holder>Silicon Graphics, Inc.</holder> |
||
| 10 | </copyright> |
||
| 11 | </refmetainfo> |
||
| 12 | <refentrytitle>glXCreateContext</refentrytitle> |
||
| 13 | <manvolnum>3G</manvolnum> |
||
| 14 | </refmeta> |
||
| 15 | <refnamediv> |
||
| 16 | <refname>glXCreateContext</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>glXCreateContext</function></funcdef> |
||
| 23 | <paramdef>Display * <parameter>dpy</parameter></paramdef> |
||
| 24 | <paramdef>XVisualInfo * <parameter>vis</parameter></paramdef> |
||
| 25 | <paramdef>GLXContext <parameter>shareList</parameter></paramdef> |
||
| 26 | <paramdef>Bool <parameter>direct</parameter></paramdef> |
||
| 27 | </funcprototype> |
||
| 28 | </funcsynopsis> |
||
| 29 | </refsynopsisdiv> |
||
| 30 | <!-- eqn: ignoring delim $$ --> |
||
| 31 | <refsect1 id="parameters"><title>Parameters</title> |
||
| 32 | <variablelist> |
||
| 33 | <varlistentry> |
||
| 34 | <term><parameter>dpy</parameter></term> |
||
| 35 | <listitem> |
||
| 36 | <para> |
||
| 37 | Specifies the connection to the X server. |
||
| 38 | </para> |
||
| 39 | </listitem> |
||
| 40 | </varlistentry> |
||
| 41 | <varlistentry> |
||
| 42 | <term><parameter>vis</parameter></term> |
||
| 43 | <listitem> |
||
| 44 | <para> |
||
| 45 | Specifies the visual that defines the frame buffer resources available to |
||
| 46 | the rendering context. |
||
| 47 | It is a pointer to an <constant>XVisualInfo</constant> structure, |
||
| 48 | not a visual ID or a pointer to a <constant>Visual</constant>. |
||
| 49 | </para> |
||
| 50 | </listitem> |
||
| 51 | </varlistentry> |
||
| 52 | <varlistentry> |
||
| 53 | <term><parameter>shareList</parameter></term> |
||
| 54 | <listitem> |
||
| 55 | <para> |
||
| 56 | Specifies the context with which to share display lists. |
||
| 57 | <constant>NULL</constant> indicates that no sharing is to take place. |
||
| 58 | </para> |
||
| 59 | </listitem> |
||
| 60 | </varlistentry> |
||
| 61 | <varlistentry> |
||
| 62 | <term><parameter>direct</parameter></term> |
||
| 63 | <listitem> |
||
| 64 | <para> |
||
| 65 | Specifies whether rendering is to be done with a direct connection |
||
| 66 | to the graphics system if possible (<constant>True</constant>) |
||
| 67 | or through the X server (<constant>False</constant>). |
||
| 68 | </para> |
||
| 69 | </listitem> |
||
| 70 | </varlistentry> |
||
| 71 | </variablelist> |
||
| 72 | </refsect1> |
||
| 73 | <refsect1 id="description"><title>Description</title> |
||
| 74 | <para> |
||
| 75 | <function>glXCreateContext</function> creates a GLX rendering context and returns its handle. |
||
| 76 | This context can be used to render into both windows and GLX pixmaps. |
||
| 77 | If <function>glXCreateContext</function> fails to create a rendering context, |
||
| 78 | <constant>NULL</constant> is returned. |
||
| 79 | </para> |
||
| 80 | <para> |
||
| 81 | If <parameter>direct</parameter> is <constant>True</constant>, |
||
| 82 | then a direct rendering context is created if the |
||
| 83 | implementation supports direct rendering, if the connection is to an X |
||
| 84 | server that is local, and if a direct rendering context is available. (An implementation may return an indirect context when <parameter>direct</parameter> is <constant>True</constant>.) |
||
| 85 | If <parameter>direct</parameter> is <constant>False</constant>, |
||
| 86 | then a rendering context that renders through the X server is always created. |
||
| 87 | Direct rendering provides a performance advantage in some implementations. |
||
| 88 | However, direct rendering contexts cannot be shared outside a single process, |
||
| 89 | and they may be unable to render to GLX pixmaps. |
||
| 90 | </para> |
||
| 91 | <para> |
||
| 92 | If <parameter>shareList</parameter> is not <constant>NULL</constant>, |
||
| 93 | then all display-list indexes and definitions are shared by |
||
| 94 | context <parameter>shareList</parameter> and by the newly created context. |
||
| 95 | An arbitrary number of contexts can share a single display-list space. |
||
| 96 | However, |
||
| 97 | all rendering contexts that share a single display-list space must |
||
| 98 | themselves exist in the same address space. |
||
| 99 | Two rendering contexts share an address space if both are nondirect |
||
| 100 | using the same server, |
||
| 101 | or if both are direct and owned by a single process. |
||
| 102 | Note that in the nondirect case, it is not necessary for the calling |
||
| 103 | threads to share an address space, |
||
| 104 | only for their related rendering contexts to share an address space. |
||
| 105 | </para> |
||
| 106 | <para> |
||
| 107 | If the GL version is 1.1 or greater, |
||
| 108 | then all texture objects except object 0 |
||
| 109 | are shared by any contexts that share display lists. |
||
| 110 | </para> |
||
| 111 | </refsect1> |
||
| 112 | <refsect1 id="notes"><title>Notes</title> |
||
| 113 | <para> |
||
| 114 | <constant>XVisualInfo</constant> is defined in <emphasis>Xutil.h.</emphasis> |
||
| 115 | It is a structure that includes <emphasis>visual</emphasis>, <emphasis>visualID</emphasis>, <emphasis>screen</emphasis>, and |
||
| 116 | <emphasis>depth</emphasis> elements. |
||
| 117 | </para> |
||
| 118 | <para> |
||
| 119 | A <emphasis>process</emphasis> is a single execution environment, |
||
| 120 | implemented in a single address space, |
||
| 121 | consisting of one or more threads. |
||
| 122 | </para> |
||
| 123 | <para> |
||
| 124 | A <emphasis>thread</emphasis> is one of a set of subprocesses that share |
||
| 125 | a single address space, |
||
| 126 | but maintain separate program counters, |
||
| 127 | stack spaces, |
||
| 128 | and other related global data. |
||
| 129 | A <emphasis>thread</emphasis> that is the only member of its subprocess group |
||
| 130 | is equivalent to a <emphasis>process</emphasis>. |
||
| 131 | </para> |
||
| 132 | <para> |
||
| 133 | It may not be possible to render to a GLX pixmap with a direct rendering |
||
| 134 | context. |
||
| 135 | </para> |
||
| 136 | </refsect1> |
||
| 137 | <refsect1 id="errors"><title>Errors</title> |
||
| 138 | <para> |
||
| 139 | <constant>NULL</constant> is returned if execution fails on the client side. |
||
| 140 | </para> |
||
| 141 | <para> |
||
| 142 | <constant>BadMatch</constant> is generated if the context to be created would not |
||
| 143 | share the address space or the screen of the context specified by <parameter>shareList</parameter>. |
||
| 144 | </para> |
||
| 145 | <para> |
||
| 146 | <constant>BadValue</constant> is generated if <parameter>vis</parameter> is not a valid visual (for |
||
| 147 | example, if a particular GLX implementation does not support it). |
||
| 148 | </para> |
||
| 149 | <para> |
||
| 150 | <constant>GLXBadContext</constant> is generated if <parameter>shareList</parameter> is not a GLX context |
||
| 151 | and is not <constant>NULL</constant>. |
||
| 152 | </para> |
||
| 153 | <para> |
||
| 154 | <constant>BadAlloc</constant> is generated if the server does not have enough |
||
| 155 | resources to allocate the new context. |
||
| 156 | </para> |
||
| 157 | </refsect1> |
||
| 158 | <refsect1 id="seealso"><title>See Also</title> |
||
| 159 | <para> |
||
| 160 | <citerefentry><refentrytitle>glXDestroyContext</refentrytitle></citerefentry>, |
||
| 161 | <citerefentry><refentrytitle>glXGetConfig</refentrytitle></citerefentry>, |
||
| 162 | <citerefentry><refentrytitle>glXIsDirect</refentrytitle></citerefentry>, |
||
| 163 | <citerefentry><refentrytitle>glXMakeCurrent</refentrytitle></citerefentry> |
||
| 164 | </para> |
||
| 165 | </refsect1> |
||
| 166 | <refsect1 id="Copyright"><title>Copyright</title> |
||
| 167 | <para> |
||
| 168 | Copyright <trademark class="copyright"></trademark> 1991-2006 |
||
| 169 | Silicon Graphics, Inc. This document is licensed under the SGI |
||
| 170 | Free Software B License. For details, see |
||
| 171 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. |
||
| 172 | </para> |
||
| 173 | </refsect1> |
||
| 174 | </refentry> |