1<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:base="" xml:id="eglSurfaceAttrib"> 2 <info> 3 <copyright> 4 <year>2003-2014</year> 5 <holder>The Khronos Group Inc.</holder> 6 </copyright> 7 </info> 8 <refmeta> 9 <refentrytitle>eglSurfaceAttrib</refentrytitle> 10 <manvolnum>3G</manvolnum> 11 </refmeta> 12 <refnamediv> 13 <refname>eglSurfaceAttrib</refname> 14 <refpurpose> 15 set an <acronym>EGL</acronym> surface attribute 16 </refpurpose> 17 </refnamediv> 18 <refsynopsisdiv> 19 <title>C Specification</title> 20 <funcsynopsis> 21 <funcprototype> 22 <funcdef>EGLBoolean <function>eglSurfaceAttrib</function></funcdef> 23 <paramdef>EGLDisplay <parameter>display</parameter></paramdef> 24 <paramdef>EGLSurface <parameter>surface</parameter></paramdef> 25 <paramdef>EGLint <parameter>attribute</parameter></paramdef> 26 <paramdef>EGLint <parameter>value</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> 35 <para> 36 Specifies the EGL display connection. 37 </para> 38 </listitem> 39 </varlistentry> 40 <varlistentry> 41 <term><parameter>surface</parameter></term> 42 <listitem> 43 <para> 44 Specifies the EGL surface. 45 </para> 46 </listitem> 47 </varlistentry> 48 <varlistentry> 49 <term><parameter>attribute</parameter></term> 50 <listitem> 51 <para> 52 Specifies the EGL surface attribute to set. 53 </para> 54 </listitem> 55 </varlistentry> 56 <varlistentry> 57 <term><parameter>value</parameter></term> 58 <listitem> 59 <para> 60 Specifies the attributes required value. 61 </para> 62 </listitem> 63 </varlistentry> 64 </variablelist> 65 </refsect1> 66 <refsect1 xml:id="description"><title>Description</title> 67 <para> 68 <function>eglSurfaceAttrib</function> sets the value of 69 <parameter>attribute</parameter> for 70 <parameter>surface</parameter> to 71 <parameter>value</parameter>. 72 <parameter>attribute</parameter> can be one of the 73 following: 74 </para> 75 <variablelist> 76 <varlistentry> 77 <term><constant>EGL_MIPMAP_LEVEL</constant></term> 78 <listitem><para> 79 For mipmap textures, the 80 <constant>EGL_MIPMAP_LEVEL</constant> attribute 81 indicates which level of the mipmap should be 82 rendered. If the value of this attribute is outside 83 the range of supported mipmap levels, the closest 84 valid mipmap level is selected for rendering. The 85 default value is <constant>0</constant>. 86 </para></listitem> 87 </varlistentry> 88 <varlistentry> 89 <term><constant>EGL_MULTISAMPLE_RESOLVE</constant></term> 90 <listitem> 91 <para> 92 Specifies the filter to use when resolving the 93 multisample buffer (this may occur when swapping or 94 copying the surface, or when changing the client API 95 context bound to the surface). A 96 <parameter>value</parameter> of 97 <constant>EGL_MULTISAMPLE_RESOLVE_DEFAULT</constant> 98 chooses the default implementation-defined filtering 99 method, while 100 <constant>EGL_MULTISAMPLE_RESOLVE_BOX</constant> 101 chooses a one-pixel wide box filter placing equal 102 weighting on all multisample values. 103 </para> 104 <para> 105 The initial value of 106 <constant>EGL_MULTISAMPLE_RESOLVE</constant> is 107 <constant>EGL_MULTISAMPLE_RESOLVE_DEFAULT</constant>. 108 </para> 109 </listitem> 110 </varlistentry> 111 <varlistentry> 112 <term><constant>EGL_SWAP_BEHAVIOR</constant></term> 113 <listitem> 114 <para> 115 Specifies the effect on the color buffer of posting 116 a surface with 117 <citerefentry><refentrytitle>eglSwapBuffers</refentrytitle></citerefentry>. 118 A <parameter>value</parameter> of 119 <constant>EGL_BUFFER_PRESERVED</constant> indicates 120 that color buffer contents are unaffected, while 121 <constant>EGL_BUFFER_DESTROYED</constant> indicates 122 that color buffer contents may be destroyed or 123 changed by the operation. 124 </para> 125 <para> 126 The initial value of 127 <constant>EGL_SWAP_BEHAVIOR</constant> is chosen by 128 the implementation. 129 </para> 130 </listitem> 131 </varlistentry> 132 </variablelist> 133 </refsect1> 134 <refsect1 xml:id="notes"><title>Notes</title> 135 <para> 136 Attribute <constant>EGL_MULTISAMPLE_RESOLVE</constant> is 137 supported only if the EGL version is 1.4 or greater. 138 </para> 139 <para> 140 Attribute <constant>EGL_SWAP_BEHAVIOR</constant> is 141 supported only if the EGL version is 1.2 or greater. 142 </para> 143 <para> 144 If the value of pbuffer attribute 145 <constant>EGL_TEXTURE_FORMAT</constant> is 146 <constant>EGL_NO_TEXTURE</constant>, the value of attribute 147 <constant>EGL_TEXTURE_TARGET</constant> is 148 <constant>EGL_NO_TEXTURE</constant>, or 149 <parameter>surface</parameter> is not a pbuffer, then 150 attribute <constant>EGL_MIPMAP_LEVEL</constant> may be set, 151 but has no effect. 152 </para> 153 </refsect1> 154 <refsect1 xml:id="errors"><title>Errors</title> 155 <para> 156 <constant>EGL_FALSE</constant> is returned on failure, 157 <constant>EGL_TRUE</constant> otherwise. 158 </para> 159 <para> 160 <constant>EGL_BAD_DISPLAY</constant> is generated if 161 <parameter>display</parameter> is not an EGL display connection. 162 </para> 163 <para> 164 <constant>EGL_BAD_MATCH</constant> is generated if 165 <parameter>attribute</parameter> is 166 <constant>EGL_MULTISAMPLE_RESOLVE</constant>, 167 <parameter>value</parameter> is 168 <constant>EGL_MULTISAMPLE_RESOLVE_BOX</constant>, and the 169 <constant>EGL_SURFACE_TYPE</constant> attribute of the 170 <type>EGLConfig</type> used to create 171 <parameter>surface</parameter> does not contain 172 <constant>EGL_MULTISAMPLE_RESOLVE_BOX_BIT</constant>. 173 </para> 174 <para> 175 <constant>EGL_BAD_MATCH</constant> is generated if 176 <parameter>attribute</parameter> is 177 <constant>EGL_SWAP_BEHAVIOR</constant>, 178 <parameter>value</parameter> is 179 <constant>EGL_BUFFER_PRESERVED</constant>, and the 180 <constant>EGL_SURFACE_TYPE</constant> attribute of the 181 <type>EGLConfig</type> used to create 182 <parameter>surface</parameter> does not contain 183 <constant>EGL_SWAP_BEHAVIOR_PRESERVED_BIT</constant>. 184 </para> 185 <para> 186 <constant>EGL_NOT_INITIALIZED</constant> is generated if 187 <parameter>display</parameter> has not been initialized. 188 </para> 189 <para> 190 <constant>EGL_BAD_SURFACE</constant> is generated if 191 <parameter>surface</parameter> is not an EGL surface. 192 </para> 193 <para> 194 <constant>EGL_BAD_ATTRIBUTE</constant> is generated if 195 <parameter>attribute</parameter> is not a valid surface attribute. 196 </para> 197 </refsect1> 198 <refsect1 xml:id="seealso"><title>See Also</title> 199 <para> 200 <citerefentry><refentrytitle>eglCreatePbufferSurface</refentrytitle></citerefentry>, 201 <citerefentry><refentrytitle>eglCreatePixmapSurface</refentrytitle></citerefentry>, 202 <citerefentry><refentrytitle>eglCreateWindowSurface</refentrytitle></citerefentry>, 203 <citerefentry><refentrytitle>eglQuerySurface</refentrytitle></citerefentry> 204 </para> 205 </refsect1> 206 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="copyright.xml"/> 207</refentry> 208