• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <title xmlns:xlink="http://www.w3.org/1999/xlink">eglCreateContext - EGL Reference Pages</title>
5    <link rel="stylesheet" type="text/css" href="khronos-man.css"/>
6    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/>
7  </head>
8  <body>
9    <header/>
10    <div class="refentry" id="eglCreateContext">
11      <div class="titlepage"/>
12      <div class="refnamediv">
13        <h2>Name</h2>
14        <p>eglCreateContext —
15            create a new <abbr class="acronym">EGL</abbr> rendering context
16        </p>
17      </div>
18      <div class="refsynopsisdiv">
19        <h2>C Specification</h2>
20        <div class="funcsynopsis">
21          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
22            <tr>
23              <td>
24                <code class="funcdef">EGLContext <strong class="fsfunc">eglCreateContext</strong>(</code>
25              </td>
26              <td>EGLDisplay <var class="pdparam">display</var>, </td>
27            </tr>
28            <tr>
29              <td> </td>
30              <td>EGLConfig <var class="pdparam">config</var>, </td>
31            </tr>
32            <tr>
33              <td> </td>
34              <td>EGLContext <var class="pdparam">share_context</var>, </td>
35            </tr>
36            <tr>
37              <td> </td>
38              <td>EGLint const * <var class="pdparam">attrib_list</var><code>)</code>;</td>
39            </tr>
40          </table>
41          <div class="funcprototype-spacer"> </div>
42        </div>
43      </div>
44      <div class="refsect1" id="parameters">
45        <h2>Parameters</h2>
46        <div class="variablelist">
47          <dl class="variablelist">
48            <dt>
49              <span class="term">
50                <em class="parameter">
51                  <code>display</code>
52                </em>
53              </span>
54            </dt>
55            <dd>
56              <p>
57                    Specifies the
58                    <abbr class="acronym">EGL</abbr>
59                    display connection.
60                </p>
61            </dd>
62            <dt>
63              <span class="term">
64                <em class="parameter">
65                  <code>config</code>
66                </em>
67              </span>
68            </dt>
69            <dd>
70              <p>Specifies the EGL frame buffer configuration that
71                    defines the frame buffer resource available to the rendering context.
72                </p>
73            </dd>
74            <dt>
75              <span class="term">
76                <em class="parameter">
77                  <code>share_context</code>
78                </em>
79              </span>
80            </dt>
81            <dd>
82              <p>
83                    Specifies another
84                    <abbr class="acronym">EGL</abbr>
85                    rendering context with which to share data, as
86                    defined by the client API corresponding to the
87                    contexts. Data is also shared with all other
88                    contexts with which
89                    <em class="parameter"><code>share_context</code></em> shares data.
90                    <code class="constant">EGL_NO_CONTEXT</code> indicates that
91                    no sharing is to take place.
92                </p>
93            </dd>
94            <dt>
95              <span class="term">
96                <em class="parameter">
97                  <code>attrib_list</code>
98                </em>
99              </span>
100            </dt>
101            <dd>
102              <p>
103                    Specifies attributes and attribute values for the
104                    context being created. Only the attribute
105                    <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code> may
106                    be specified.
107                </p>
108            </dd>
109          </dl>
110        </div>
111      </div>
112      <div class="refsect1" id="description">
113        <h2>Description</h2>
114        <p>
115            <code class="function">eglCreateContext</code> creates an EGL
116            rendering context for the current rendering API (as set with
117            <code class="function">eglBindAPI</code>) and returns a handle to the
118            context. The context can then be used to render into an EGL
119            drawing surface. If <code class="function">eglCreateContext</code>
120            fails to create a rendering context,
121            <code class="constant">EGL_NO_CONTEXT</code> is returned.
122        </p>
123        <p>
124            If <em class="parameter"><code>share_context</code></em> is not
125            <code class="constant">EGL_NO_CONTEXT</code>, then all shareable data
126            in the context (as defined by the client API specification
127            for the current rendering API) are shared by context
128            <em class="parameter"><code>share_context</code></em>, all other contexts
129            <em class="parameter"><code>share_context</code></em> already shares with,
130            and the newly created context. An arbitrary number of
131            rendering contexts can share data. However, all rendering
132            contexts that share data must themselves exist in the same
133            address space. Two rendering contexts share an address space
134            if both are owned by a single process.
135        </p>
136        <p>
137            <em class="parameter"><code>attrib_list</code></em> specifies a list of
138            attributes for the context. The list has the same structure
139            as described for <code class="function">eglChooseConfig</code>. The
140            attributes and attribute values which may be specified are
141            as follows:
142        </p>
143        <div class="variablelist">
144          <dl class="variablelist">
145            <dt>
146              <span class="term">
147                <code class="constant">EGL_CONTEXT_MAJOR_VERSION</code>
148              </span>
149            </dt>
150            <dd>
151              <p>
152                    Must be followed by an integer specifying the requested
153                    major version of an OpenGL or OpenGL ES context. The
154                    default value is 1. This attribute is an alias of the
155                    older <code class="constant">EGL_CONTEXT_CLIENT_VERSION</code>,
156                    and the tokens may be used interchangeably.
157                </p>
158            </dd>
159            <dt>
160              <span class="term">
161                <code class="constant">EGL_CONTEXT_MINOR_VERSION</code>
162              </span>
163            </dt>
164            <dd>
165              <p>
166                    Must be followed by an integer specifying the requested
167                    minor version of an OpenGL or OpenGL ES context. The
168                    default value is 0.
169                </p>
170            </dd>
171            <dt>
172              <span class="term">
173                <code class="constant">EGL_CONTEXT_OPENGL_PROFILE_MASK</code>
174              </span>
175            </dt>
176            <dd>
177              <p>
178                    Must be followed by an integer bitmask specifying the
179                    <em class="firstterm">profile</em> of an OpenGL context.
180                    Bits which may be set include
181                    <code class="constant">EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT</code>
182                    for a core profile and
183                    <code class="constant">EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT</code>
184                    for a compatibility profile. The default value is
185                    <code class="constant">EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT</code>.
186                    All OpenGL 3.2 and later implementations are required to
187                    implement the core profile, but implementation of the
188                    compatibility profile is optional.
189                </p>
190            </dd>
191            <dt>
192              <span class="term">
193                <code class="constant">EGL_CONTEXT_OPENGL_DEBUG</code>
194              </span>
195            </dt>
196            <dd>
197              <p>
198                    Must be followed by <code class="constant">EGL_TRUE</code>,
199                    specifying that an OpenGL or OpenGL ES <em class="firstterm">debug
200                    context</em> should be created, or
201                    <code class="constant">EGL_FALSE</code>, if a non-debug context
202                    should be created. The default value is
203                    <code class="constant">EGL_FALSE</code>.
204                </p>
205            </dd>
206            <dt>
207              <span class="term">
208                <code class="constant">EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE</code>
209              </span>
210            </dt>
211            <dd>
212              <p>
213                    Must be followed by <code class="constant">EGL_TRUE</code>,
214                    specifying that a
215                    <em class="firstterm">forward-compatible</em> OpenGL context
216                    should be created, or <code class="constant">EGL_FALSE</code>, if
217                    a non-forward-compatible context should be created. The
218                    default value is <code class="constant">EGL_FALSE</code>.
219                </p>
220            </dd>
221            <dt>
222              <span class="term">
223                <code class="constant">EGL_CONTEXT_OPENGL_ROBUST_ACCESS</code>
224              </span>
225            </dt>
226            <dd>
227              <p>
228                    Must be followed by <code class="constant">EGL_TRUE</code>,
229                    specifying that an OpenGL or OpenGL ES context
230                    supporting <em class="firstterm">robust buffer access</em>
231                    should be created, or <code class="constant">EGL_FALSE</code>, if
232                    a non-robust context should be created. The default
233                    value is <code class="constant">EGL_FALSE</code>.
234                </p>
235            </dd>
236            <dt>
237              <span class="term">
238                <code class="constant">EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY</code>
239              </span>
240            </dt>
241            <dd>
242              <p>
243                    Must be followed by
244                    <code class="constant">EGL_LOSE_CONTEXT_ON_RESET</code>,
245                    specifying that an OpenGL or OpenGL ES context with
246                    reset notification behavior
247                    <code class="constant">GL_LOSE_CONTEXT_ON_RESET_ARB</code> should
248                    be created, or
249                    <code class="constant">EGL_NO_RESET_NOTIFICATION</code>,
250                    specifying that an OpenGL or OpenGL ES context with
251                    reset notification behavior
252                    <code class="constant">GL_NO_RESET_NOTIFICATION_ARB</code> should
253                    be created, as described by the
254                    <code class="constant">GL_ARB_robustness</code> extension.
255                </p>
256              <p>
257                    If the
258                    <code class="constant">EGL_CONTEXT_OPENGL_ROBUST_ACCESS</code>
259                    attribute is not set to <code class="constant">EGL_TRUE</code>,
260                    context creation will not fail, but the resulting
261                    context may not support robust buffer access, and
262                    therefore may not support the requested reset
263                    notification strategy The default value for
264                    <code class="constant">EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY</code>
265                    is <code class="constant">EGL_NO_RESET_NOTIFICATION</code> .
266                </p>
267            </dd>
268          </dl>
269        </div>
270        <p>
271            There are many possible interactions between requested OpenGL
272            and OpenGL ES context creation attributes, depending on the API
273            versions and extensions supported by the implementation. These
274            interactions are described in detail in the EGL 1.5
275            Specification, but are not listed here for compactness. The
276            requested attributes may not be able to be satisfied, but
277            context creation may still succeed. Applications should ensure
278            that the OpenGL or OpenGL ES contexts supports needed features
279            before using them, by determining the actual context version,
280            supported extensions, and supported context flags using runtime
281            queries.
282        </p>
283      </div>
284    </div>
285    <footer/>
286  </body>
287</html>
288