1<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglCreateContext"> 2 <info> 3 <copyright> 4 <year>2003-2018</year> 5 <holder>The Khronos Group Inc.</holder> 6 </copyright> 7 </info> 8 <refmeta> 9 <refentrytitle>eglCreateContext</refentrytitle> 10 <manvolnum>3G</manvolnum> 11 </refmeta> 12 <refnamediv> 13 <refname>eglCreateContext</refname> 14 <refpurpose> 15 create a new <acronym>EGL</acronym> rendering context 16 </refpurpose> 17 </refnamediv> 18 <refsynopsisdiv> 19 <title>C Specification</title> 20 <funcsynopsis> 21 <funcprototype> 22 <funcdef>EGLContext <function>eglCreateContext</function></funcdef> 23 <paramdef>EGLDisplay <parameter>display</parameter></paramdef> 24 <paramdef>EGLConfig <parameter>config</parameter></paramdef> 25 <paramdef>EGLContext <parameter>share_context</parameter></paramdef> 26 <paramdef>EGLint const * <parameter>attrib_list</parameter></paramdef> 27 </funcprototype> 28 </funcsynopsis> 29 </refsynopsisdiv> 30 <refsect1 xml:id="parameters"><title>Parameters</title> 31 <variablelist> 32 <varlistentry> 33 <term><parameter>display</parameter></term> 34 <listitem><para> 35 Specifies the 36 <acronym>EGL</acronym> 37 display connection. 38 </para></listitem> 39 </varlistentry> 40 <varlistentry> 41 <term><parameter>config</parameter></term> 42 <listitem><para>Specifies the EGL frame buffer configuration that 43 defines the frame buffer resource available to the rendering context. 44 </para></listitem> 45 </varlistentry> 46 <varlistentry> 47 <term><parameter>share_context</parameter></term> 48 <listitem><para> 49 Specifies another 50 <acronym>EGL</acronym> 51 rendering context with which to share data, as 52 defined by the client API corresponding to the 53 contexts. Data is also shared with all other 54 contexts with which 55 <parameter>share_context</parameter> shares data. 56 <constant>EGL_NO_CONTEXT</constant> indicates that 57 no sharing is to take place. 58 </para> 59 </listitem> 60 </varlistentry> 61 <varlistentry> 62 <term><parameter>attrib_list</parameter></term> 63 <listitem><para> 64 Specifies attributes and attribute values for the 65 context being created. Only the attribute 66 <constant>EGL_CONTEXT_CLIENT_VERSION</constant> may 67 be specified. 68 </para></listitem> 69 </varlistentry> 70 </variablelist> 71 </refsect1> 72 <refsect1 xml:id="description"><title>Description</title> 73 <para> 74 <function>eglCreateContext</function> creates an EGL 75 rendering context for the current rendering API (as set with 76 <function>eglBindAPI</function>) and returns a handle to the 77 context. The context can then be used to render into an EGL 78 drawing surface. If <function>eglCreateContext</function> 79 fails to create a rendering context, 80 <constant>EGL_NO_CONTEXT</constant> is returned. 81 </para> 82 <para> 83 If <parameter>share_context</parameter> is not 84 <constant>EGL_NO_CONTEXT</constant>, then all shareable data 85 in the context (as defined by the client API specification 86 for the current rendering API) are shared by context 87 <parameter>share_context</parameter>, all other contexts 88 <parameter>share_context</parameter> already shares with, 89 and the newly created context. An arbitrary number of 90 rendering contexts can share data. However, all rendering 91 contexts that share data must themselves exist in the same 92 address space. Two rendering contexts share an address space 93 if both are owned by a single process. 94 </para> 95 <para> 96 <parameter>attrib_list</parameter> specifies a list of 97 attributes for the context. The list has the same structure 98 as described for <function>eglChooseConfig</function>. The 99 attributes and attribute values which may be specified are 100 as follows: 101 </para> 102 <variablelist> 103 <varlistentry> 104 <term><constant>EGL_CONTEXT_MAJOR_VERSION</constant></term> 105 <listitem><para> 106 Must be followed by an integer specifying the requested 107 major version of an OpenGL or OpenGL ES context. The 108 default value is 1. This attribute is an alias of the 109 older <constant>EGL_CONTEXT_CLIENT_VERSION</constant>, 110 and the tokens may be used interchangeably. 111 </para></listitem> 112 </varlistentry> 113 <varlistentry> 114 <term><constant>EGL_CONTEXT_MINOR_VERSION</constant></term> 115 <listitem><para> 116 Must be followed by an integer specifying the requested 117 minor version of an OpenGL or OpenGL ES context. The 118 default value is 0. 119 </para></listitem> 120 </varlistentry> 121 <varlistentry> 122 <term><constant>EGL_CONTEXT_OPENGL_PROFILE_MASK</constant></term> 123 <listitem><para> 124 Must be followed by an integer bitmask specifying the 125 <firstterm>profile</firstterm> of an OpenGL context. 126 Bits which may be set include 127 <constant>EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT</constant> 128 for a core profile and 129 <constant>EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT</constant> 130 for a compatibility profile. The default value is 131 <constant>EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT</constant>. 132 All OpenGL 3.2 and later implementations are required to 133 implement the core profile, but implementation of the 134 compatibility profile is optional. 135 </para></listitem> 136 </varlistentry> 137 <varlistentry> 138 <term><constant>EGL_CONTEXT_OPENGL_DEBUG</constant></term> 139 <listitem><para> 140 Must be followed by <constant>EGL_TRUE</constant>, 141 specifying that an OpenGL or OpenGL ES <firstterm>debug 142 context</firstterm> should be created, or 143 <constant>EGL_FALSE</constant>, if a non-debug context 144 should be created. The default value is 145 <constant>EGL_FALSE</constant>. 146 </para></listitem> 147 </varlistentry> 148 <varlistentry> 149 <term><constant>EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE</constant></term> 150 <listitem><para> 151 Must be followed by <constant>EGL_TRUE</constant>, 152 specifying that a 153 <firstterm>forward-compatible</firstterm> OpenGL context 154 should be created, or <constant>EGL_FALSE</constant>, if 155 a non-forward-compatible context should be created. The 156 default value is <constant>EGL_FALSE</constant>. 157 </para></listitem> 158 </varlistentry> 159 <varlistentry> 160 <term><constant>EGL_CONTEXT_OPENGL_ROBUST_ACCESS</constant></term> 161 <listitem><para> 162 Must be followed by <constant>EGL_TRUE</constant>, 163 specifying that an OpenGL or OpenGL ES context 164 supporting <firstterm>robust buffer access</firstterm> 165 should be created, or <constant>EGL_FALSE</constant>, if 166 a non-robust context should be created. The default 167 value is <constant>EGL_FALSE</constant>. 168 </para></listitem> 169 </varlistentry> 170 <varlistentry> 171 <term><constant>EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY</constant></term> 172 <listitem><para> 173 Must be followed by 174 <constant>EGL_LOSE_CONTEXT_ON_RESET</constant>, 175 specifying that an OpenGL or OpenGL ES context with 176 reset notification behavior 177 <constant>GL_LOSE_CONTEXT_ON_RESET_ARB</constant> should 178 be created, or 179 <constant>EGL_NO_RESET_NOTIFICATION</constant>, 180 specifying that an OpenGL or OpenGL ES context with 181 reset notification behavior 182 <constant>GL_NO_RESET_NOTIFICATION_ARB</constant> should 183 be created, as described by the 184 <constant>GL_ARB_robustness</constant> extension. 185 </para><para> 186 If the 187 <constant>EGL_CONTEXT_OPENGL_ROBUST_ACCESS</constant> 188 attribute is not set to <constant>EGL_TRUE</constant>, 189 context creation will not fail, but the resulting 190 context may not support robust buffer access, and 191 therefore may not support the requested reset 192 notification strategy The default value for 193 <constant>EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY</constant> 194 is <constant>EGL_NO_RESET_NOTIFICATION</constant> . 195 </para></listitem> 196 </varlistentry> 197 </variablelist> 198 <para> 199 There are many possible interactions between requested OpenGL 200 and OpenGL ES context creation attributes, depending on the API 201 versions and extensions supported by the implementation. These 202 interactions are described in detail in the EGL 1.5 203 Specification, but are not listed here for compactness. The 204 requested attributes may not be able to be satisfied, but 205 context creation may still succeed. Applications should ensure 206 that the OpenGL or OpenGL ES contexts supports needed features 207 before using them, by determining the actual context version, 208 supported extensions, and supported context flags using runtime 209 queries. 210 </para> 211 </refsect1> 212</refentry> 213