• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3<!-- saved from url=(0013)about:internet -->
4<?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" xmlns:xlink="http://www.w3.org/1999/xlink" pref:renderer="mathplayer-dl">
5  <head>
6    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7    <style xmlns="" type="text/css">
8    /* This style sets a margin around the entire page */
9        html, body {
10            margin: 10px;
11        }
12
13        p {
14            font: normal 16px verdana, sans-serif;
15            margin: 0;
16            padding-bottom:12px;
17        }
18
19        h1 {
20            font: bold 25px verdana, sans-serif;
21            margin-top: 0;
22            margin-bottom: 3px;
23            padding-top: 0;
24            padding-bottom: 0;
25        }
26
27        h2 {
28            font: bold 19px verdana, sans-serif;
29            margin-top: 28px;
30            margin-bottom: 3px;
31            padding-top: 0;
32            padding-bottom: 0;
33        }
34
35        h3 {
36            font: bold 19px verdana, sans-serif !important;
37            margin-top: 28px;
38            margin-bottom: 3px;
39            padding-top: 0;
40            padding-bottom: 0;
41        }
42
43        li {
44            font: normal 16px verdana, sans-serif;
45            margin-top: 0;
46            margin-bottom: 18px;
47            padding-top: 0;
48            padding-bottom: 0;
49        }
50
51        .pdparam {
52            font: italic 16px verdana, sans-serif;
53        }
54
55                .term {
56                        font: italic 16px verdana, sans-serif;
57                        font-weight: normal;
58                }
59
60                .type {
61                        font: normal 16px verdana, sans-serif !important;
62                }
63
64                .parameter {
65                        font-style: italic;
66                        }
67
68        a:link, a:visited {
69            color: blue;
70            text-decoration: none;
71            font: normal 16px;
72        }
73
74        a:hover {
75            background-color: #FFFF99;
76            font: normal 16px;
77        }
78
79        div.funcsynopsis {
80            text-align: left;
81            background-color: #e6e6e6;
82            font: normal 16px verdana, sans-serif;
83                        padding-top: 10px;
84                        padding-bottom: 10px;
85        }
86
87        div.funcsynopsis table {
88            border-collapse: separate;
89            font: normal 16px verdana, sans-serif;
90        }
91
92        div.funcsynopsis td {
93            background-color: #e6e6e6;
94            border: 0 solid #000;
95            padding: 1px;
96            font: normal 16px verdana, sans-serif;
97        }
98
99        div.refsect1 {
100            font-family: verdana, sans-serif;
101            font-size: 16px;
102        }
103
104        code.constant {
105            font: normal 16px courier new, monospace !important;
106        }
107
108                span.errorname {
109            font: normal 16px verdana, sans-serif !important;
110        }
111
112        code.function {
113            font: bold 16px verdana, sans-serif !important;
114        }
115
116        b.fsfunc {
117            font: bold 16px verdana, sans-serif !important;
118        }
119
120        code.varname {
121            font: italic 16px verdana, sans-serif;
122        }
123
124        code.replaceable {
125            font: italic 16px courier new, monospace;
126        }
127
128        code.funcdef {
129            font: normal 16px verdana, sans-serif !important;
130        }
131
132        .citerefentry {
133            font: normal 16px verdana, sans-serif !important;
134        }
135
136        .parameter {
137            font-style: italic;
138        }
139
140        code.fsfunc {
141            font: normal 16px verdana, sans-serif !important;
142        }
143
144        /* PARAMETER: This style controls spacing between the terms in Parameter section */
145        dt {
146            margin-top: 15px;
147        }
148
149        /* TABLES: These styles apply to all tables OTHER than the Synopsis and Example tables */
150        div.refsect1 table {
151            width: 100%;
152                        margin-top: 10px;
153            background-color: #FFF;
154                        border-collapse: collapse;
155                        border-color: #000;
156            border-width: 1px;
157                        font: normal 16px verdana, sans-serif;
158        }
159
160        div.refsect1 th {
161                        border-collapse: collapse;
162                        border-color: #000;
163            border-width: 1px;
164            font: bold 16px verdana, sans-serif;
165        }
166
167        div.refsect1 td {
168            background-color: #FFF;
169            padding: 5px;
170            vertical-align: text-top;
171                        border-collapse: collapse;
172                        border-color: #000;
173            border-width: 1px;
174            font: normal 16px verdana, sans-serif;
175        }
176
177                  div.refsect1 p{
178            font: normal 16px verdana, sans-serif;
179            margin-top: 8px;
180            margin-bottom: 8px;
181            padding-top: 0;
182            padding-bottom: 0;
183        }
184
185
186        /* EXAMPLE: These styles apply only to the Example section */
187        div.refsect2 {
188            font: normal 16px courier new, monospace !important;
189        }
190
191        div.refsect2 table {
192            margin-top: 0;
193            background-color: #e6e6e6;
194            width: 100%;
195            border: 0 solid #000;
196            padding: 2px;
197            font: normal 16px courier new, monospace !important;
198        }
199
200        div.refsect2 td {
201            background-color: #e6e6e6;
202            font: normal 16px courier new, monospace !important;
203                        white-space:pre;
204        }
205
206        /* COPYRIGHT: This style formats the text of the copyright statement at the bottom of the page */
207        div.refsect3 {
208            font: normal 11px verdana, sans-serif;
209            margin-top: 50px;
210            margin-bottom: 20px;
211            padding-top: 0;
212            padding-bottom: 0;
213        }
214
215</style>
216    <title>eglCreateContext</title>
217    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
218  </head>
219  <body>
220    <div class="refentry">
221      <a id="eglCreateContext"></a>
222      <div class="titlepage"></div>
223      <div xmlns="" class="refnamediv">
224        <h1>eglCreateContext</h1>
225        <p>
226            create a new <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">EGL</acronym> rendering context
227        </p>
228      </div>
229      <div class="refsynopsisdiv">
230        <h2>C Specification</h2>
231        <div class="funcsynopsis">
232          <table xmlns="" border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
233            <tr valign="bottom">
234              <td>
235                <code xmlns="http://www.w3.org/1999/xhtml" class="funcdef">EGLContext <strong class="fsfunc">eglCreateContext</strong>(</code>
236                <td>EGLDisplay  <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">display</var>, </td>
237              </td>
238            </tr>
239            <tr valign="top">
240              <td> </td>
241              <td>EGLConfig  <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">config</var>, </td>
242            </tr>
243            <tr valign="top">
244              <td> </td>
245              <td>EGLContext  <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">share_context</var>, </td>
246            </tr>
247            <tr valign="top">
248              <td> </td>
249              <td>EGLint const *  <var xmlns="http://www.w3.org/1999/xhtml" class="pdparam">attrib_list</var><code>)</code></td>
250            </tr>
251          </table>
252        </div>
253      </div>
254      <div class="refsect1">
255        <a id="parameters"></a>
256        <h2>Parameters</h2>
257        <div class="variablelist">
258          <dl class="variablelist">
259            <dt>
260              <span class="term">
261                <em class="parameter">
262                  <code>display</code>
263                </em>
264              </span>
265            </dt>
266            <dd>
267              <p>
268                    Specifies the
269                    <acronym class="acronym">EGL</acronym>
270                    display connection.
271                </p>
272            </dd>
273            <dt>
274              <span class="term">
275                <em class="parameter">
276                  <code>config</code>
277                </em>
278              </span>
279            </dt>
280            <dd>
281              <p>Specifies the EGL frame buffer configuration that
282                    defines the frame buffer resource available to the rendering context.
283                </p>
284            </dd>
285            <dt>
286              <span class="term">
287                <em class="parameter">
288                  <code>share_context</code>
289                </em>
290              </span>
291            </dt>
292            <dd>
293              <p>
294                    Specifies another
295                    <acronym class="acronym">EGL</acronym>
296                    rendering context with which to share data, as
297                    defined by the client API corresponding to the
298                    contexts. Data is also shared with all other
299                    contexts with which
300                    <em class="parameter"><code>share_context</code></em> shares data.
301                    <code class="constant">EGL_NO_CONTEXT</code> indicates that
302                    no sharing is to take place.
303                </p>
304            </dd>
305            <dt>
306              <span class="term">
307                <em class="parameter">
308                  <code>attrib_list</code>
309                </em>
310              </span>
311            </dt>
312            <dd>
313              <p>
314                    Specifies attributes and attribute values for the
315                    context being created. Only the attribute
316                    <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code> may
317                    be specified.
318                </p>
319            </dd>
320          </dl>
321        </div>
322      </div>
323      <div class="refsect1">
324        <a id="description"></a>
325        <h2>Description</h2>
326        <p>
327            <code class="function">eglCreateContext</code> creates an EGL
328            rendering context for the current rendering API (as set with
329            <code class="function">eglBindAPI</code>) and returns a handle to the
330            context. The context can then be used to render into an EGL
331            drawing surface. If <code class="function">eglCreateContext</code>
332            fails to create a rendering context,
333            <code class="constant">EGL_NO_CONTEXT</code> is returned.
334        </p>
335        <p>
336            If <em class="parameter"><code>share_context</code></em> is not
337            <code class="constant">EGL_NO_CONTEXT</code>, then all shareable data
338            in the context (as defined by the client API specification
339            for the current rendering API) are shared by context
340            <em class="parameter"><code>share_context</code></em>, all other contexts
341            <em class="parameter"><code>share_context</code></em> already shares with,
342            and the newly created context. An arbitrary number of
343            rendering contexts can share data. However, all rendering
344            contexts that share data must themselves exist in the same
345            address space. Two rendering contexts share an address space
346            if both are owned by a single process.
347        </p>
348        <p>
349            <em class="parameter"><code>attrib_list</code></em> specifies a list of
350            attributes for the context. The list has the same structure
351            as described for <code class="function">eglChooseConfig</code>. The
352            attributes and attribute values which may be specified are
353            as follows:
354        </p>
355        <div class="variablelist">
356          <dl class="variablelist">
357            <dt>
358              <span class="term">
359                <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code>
360              </span>
361            </dt>
362            <dd>
363              <p>
364                    Must be followed by an integer that determines which
365                    version of an OpenGL ES context to create. A value
366                    of 1 specifies creation of an OpenGL ES 1.x context.
367                    An attribute value of 2 specifies creation of an
368                    OpenGL ES 2.x context. The default value is 1. This
369                    attribute can only be specified when creating a
370                    OpenGL ES context (e.g. when the current rendering
371                    API is <code class="constant">EGL_OPENGL_ES_API</code>).
372                </p>
373            </dd>
374          </dl>
375        </div>
376      </div>
377      <div class="refsect1">
378        <a id="notes"></a>
379        <h2>Notes</h2>
380        <p>
381            The current rendering API is only respected if the EGL
382            version is 1.2 or greater. Otherwise, an OpenGL ES context
383            will always be created.
384        </p>
385        <p>
386            The <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code>
387            attribute is only supported if the EGL version is 1.3 or
388            greater.
389        </p>
390        <p>
391            A <em class="firstterm">process</em> is a single execution environment,
392            implemented in a single address space, consisting of one or more threads.
393        </p>
394        <p>
395            A <em class="firstterm">thread</em> is one of a set of subprocesses that
396            share a single address space, but maintain separate program counters,
397            stack spaces, and other related global data.
398            A thread is the only member of its subprocess group is equivalent to a
399            process.
400        </p>
401      </div>
402      <div class="refsect1">
403        <a id="errors"></a>
404        <h2>Errors</h2>
405        <p>
406            <code class="constant">EGL_NO_CONTEXT</code> is returned if creation of
407            the context fails.
408        </p>
409        <p>
410            <code class="constant">EGL_BAD_MATCH</code> is generated if the
411            current rendering API is <code class="constant">EGL_NONE</code> (this
412            can only arise in an EGL implementation which does not
413            support OpenGL ES, prior to the first call to
414            <code class="function">eglBindAPI</code>).
415        </p>
416        <p>
417            <code class="constant">EGL_BAD_MATCH</code> is generated if the
418            server context state for
419            <em class="parameter"><code>share_context</code></em> exists in an address
420            space which cannot be shared with the newly created context,
421            if <em class="parameter"><code>share_context</code></em> was created on a
422            different display than the one referenced by
423            <em class="parameter"><code>config</code></em>, or if the contexts are
424            otherwise incompatible.
425        </p>
426        <p>
427            <code class="constant">EGL_BAD_DISPLAY</code> is generated if
428            <em class="parameter"><code>display</code></em> is not an EGL display connection.
429        </p>
430        <p>
431            <code class="constant">EGL_NOT_INITIALIZED</code> is generated if
432            <em class="parameter"><code>display</code></em> has not been initialized.
433        </p>
434        <p>
435            <code class="constant">EGL_BAD_CONFIG</code> is generated if
436            <em class="parameter"><code>config</code></em> is not an EGL frame buffer
437            configuration, or does not support the current rendering
438            API. This includes requesting creation of an OpenGL ES 1.x
439            context when the <code class="constant">EGL_RENDERABLE_TYPE</code>
440            attribute of <em class="parameter"><code>config</code></em> does not contain
441            <code class="constant">EGL_OPENGL_ES_BIT</code>, or creation of an
442            OpenGL ES 2.x context when the attribute does not contain
443            <code class="constant">EGL_OPENGL_ES2_BIT</code>.
444        </p>
445        <p>
446            <code class="constant">EGL_BAD_CONTEXT</code> is generated if
447            <em class="parameter"><code>share_context</code></em> is not an EGL rendering
448            context of the same client API type as the newly created
449            context and is not <code class="constant">EGL_NO_CONTEXT</code>.
450        </p>
451        <p>
452            <code class="constant">EGL_BAD_ATTRIBUTE</code> is generated if
453            <em class="parameter"><code>attrib_list</code></em> contains an invalid
454            context attribute or if an attribute is not recognized or
455            out of range. Note that attribute
456            <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code> is
457            only valid when the current rendering API is
458            <code class="constant">EGL_OPENGL_ES_API</code>.
459        </p>
460        <p>
461            <code class="constant">EGL_BAD_ALLOC</code> is generated if there are not
462            enough resources to allocate the new context.
463        </p>
464      </div>
465      <div class="refsect1">
466        <a id="seealso"></a>
467        <h2>See Also</h2>
468        <p>
469            <a class="citerefentry" href="eglDestroyContext.html"><span class="citerefentry"><span class="refentrytitle">eglDestroyContext</span></span></a>,
470            <a class="citerefentry" href="eglChooseConfig.html"><span class="citerefentry"><span class="refentrytitle">eglChooseConfig</span></span></a>,
471            <a class="citerefentry" href="eglGetConfigs.html"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a>,
472            <a class="citerefentry" href="eglMakeCurrent.html"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>
473        </p>
474      </div>
475      <div xmlns="" class="refsect3" lang="en" xml:lang="en"><a xmlns="http://www.w3.org/1999/xhtml" id="Copyright"></a><h4 xmlns="http://www.w3.org/1999/xhtml"></h4><img xmlns="http://www.w3.org/1999/xhtml" src="KhronosLogo.jpg" /><p xmlns="http://www.w3.org/1999/xhtml"></p>
476Copyright © 2003-2014 The Khronos Group Inc.
477Permission is hereby granted, free of charge, to any person obtaining a
478copy of this software and/or associated documentation files (the
479"Materials"), to deal in the Materials without restriction, including
480without limitation the rights to use, copy, modify, merge, publish,
481distribute, sublicense, and/or sell copies of the Materials, and to
482permit persons to whom the Materials are furnished to do so, subject to
483the condition that this copyright notice and permission notice shall be included
484in all copies or substantial portions of the Materials.
485</div>
486    </div>
487  </body>
488</html>
489