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