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">eglCreatePixmapSurface - EGL Reference Pages</title> 5 <link rel="stylesheet" type="text/css" href="khronos-man.css"/> 6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/> 7 </head> 8 <body> 9 <header/> 10 <div class="refentry" id="eglCreatePixmapSurface"> 11 <div class="titlepage"/> 12 <div class="refnamediv"> 13 <h2>Name</h2> 14 <p>eglCreatePixmapSurface — 15 create a new <abbr class="acronym">EGL</abbr> pixmap surface 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">EGLSurface <strong class="fsfunc">eglCreatePixmapSurface</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>NativePixmapType <var class="pdparam">native_pixmap</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>Specifies the EGL display connection.</p> 57 </dd> 58 <dt> 59 <span class="term"> 60 <em class="parameter"> 61 <code>config</code> 62 </em> 63 </span> 64 </dt> 65 <dd> 66 <p> 67 Specifies the EGL frame buffer configuration that defines the 68 frame buffer resource available to the surface.</p> 69 </dd> 70 <dt> 71 <span class="term"> 72 <em class="parameter"> 73 <code>native_pixmap</code> 74 </em> 75 </span> 76 </dt> 77 <dd> 78 <p>Specifies the native pixmap.</p> 79 </dd> 80 <dt> 81 <span class="term"> 82 <em class="parameter"> 83 <code>attrib_list</code> 84 </em> 85 </span> 86 </dt> 87 <dd> 88 <p> 89 Specifies pixmap surface attributes. 90 May be <code class="constant">NULL</code> or empty 91 (first attribute is <code class="constant">EGL_NONE</code>). 92 </p> 93 </dd> 94 </dl> 95 </div> 96 </div> 97 <div class="refsect1" id="description"> 98 <h2>Description</h2> 99 <p> 100 <code class="function">eglCreatePixmapSurface</code> creates an 101 off-screen <abbr class="acronym">EGL</abbr> pixmap surface and returns 102 its handle. If <code class="function">eglCreatePixmapSurface</code> 103 fails to create a pixmap surface, 104 <code class="constant">EGL_NO_SURFACE</code> is returned. 105 </p> 106 <p> 107 Surface attributes are specified as a list of 108 attribute-value pairs, terminated with 109 <code class="constant">EGL_NONE</code>. Accepted attributes 110 are: 111 </p> 112 <div class="variablelist"> 113 <dl class="variablelist"> 114 <dt> 115 <span class="term"> 116 <code class="constant">EGL_VG_ALPHA_FORMAT</code> 117 </span> 118 </dt> 119 <dd> 120 <p> 121 Specifies how alpha values are interpreted by OpenVG 122 when rendering to the surface. If its value is 123 <code class="constant">EGL_VG_ALPHA_FORMAT_NONPRE</code>, 124 then alpha values are not premultipled. If its value 125 is <code class="constant">EGL_VG_ALPHA_FORMAT_PRE</code>, 126 then alpha values are premultiplied. The default 127 value of <code class="constant">EGL_VG_ALPHA_FORMAT</code> is 128 <code class="constant">EGL_VG_ALPHA_FORMAT_NONPRE</code>. 129 </p> 130 </dd> 131 <dt> 132 <span class="term"> 133 <code class="constant">EGL_VG_COLORSPACE</code> 134 </span> 135 </dt> 136 <dd> 137 <p> 138 Specifies the color space used by OpenVG when 139 rendering to the surface. If its value is 140 <code class="constant">EGL_VG_COLORSPACE_sRGB</code>, then a 141 non-linear, perceptually uniform color space is 142 assumed, with a corresponding 143 <span class="type">VGImageFormat</span> of form 144 <code class="constant">VG_s*</code>. If its value is 145 <code class="constant">EGL_VG_COLORSPACE_LINEAR</code>, then 146 a linear color space is assumed, with a 147 corresponding <span class="type">VGImageFormat</span> of form 148 <code class="constant">VG_l*</code>. The default value of 149 <code class="constant">EGL_VG_COLORSPACE</code> is 150 <code class="constant">EGL_VG_COLORSPACE_sRGB</code>. 151 </p> 152 </dd> 153 </dl> 154 </div> 155 <p> 156 Any EGL rendering context that was created with respect to 157 <em class="parameter"><code>config</code></em> can be used to render into the 158 surface. Use 159 <a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a> 160 to attach an EGL rendering context to the surface. 161 </p> 162 <p> 163 Use 164 <a class="citerefentry" href="eglQuerySurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglQuerySurface</span></span></a> 165 to retrieve the ID of <em class="parameter"><code>config</code></em>. 166 </p> 167 <p> 168 Use <a class="citerefentry" href="eglDestroySurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglDestroySurface</span></span></a> 169 to destroy the surface. 170 </p> 171 </div> 172 <div class="refsect1" id="notes"> 173 <h2>Notes</h2> 174 <p> 175 The <code class="constant">EGL_MATCH_NATIVE_PIXMAP</code> attribute 176 of 177 <a class="citerefentry" href="eglChooseConfig.xhtml"><span class="citerefentry"><span class="refentrytitle">eglChooseConfig</span></span></a> 178 can be used to select a frame buffer configuration matching 179 a specified native pixmap. 180 </p> 181 <p> 182 Attributes 183 <code class="constant">EGL_VG_ALPHA_FORMAT</code> and 184 <code class="constant">EGL_VG_COLORSPACE</code>, and the 185 corresponding attribute values, are supported only if the 186 EGL version is 1.2 or greater. 187 </p> 188 <p> 189 The <code class="constant">EGL_VG_ALPHA_FORMAT</code> and 190 <code class="constant">EGL_VG_COLORSPACE</code> attributes are used 191 only by OpenVG. EGL itself, and other client APIs such as 192 OpenGL and OpenGL ES , do not distinguish multiple 193 colorspace models. Refer to section 11.2 of the OpenVG 1.0 194 specification for more information. The native window 195 system's use and interpretation of alpha values is outside 196 the scope of EGL, although the preferred behavior is for the 197 window system to ignore the value of 198 <code class="constant">EGL_VG_ALPHA_FORMAT</code>. 199 </p> 200 </div> 201 <div class="refsect1" id="errors"> 202 <h2>Errors</h2> 203 <p> 204 <code class="constant">EGL_NO_SURFACE</code> is returned if creation of 205 the context fails. 206 </p> 207 <p> 208 <code class="constant">EGL_BAD_DISPLAY</code> is generated if 209 <em class="parameter"><code>display</code></em> is not an EGL display connection. 210 </p> 211 <p> 212 <code class="constant">EGL_NOT_INITIALIZED</code> is generated if 213 <em class="parameter"><code>display</code></em> has not been initialized. 214 </p> 215 <p> 216 <code class="constant">EGL_BAD_CONFIG</code> is generated if 217 <em class="parameter"><code>config</code></em> is not an EGL config. 218 </p> 219 <p> 220 <code class="constant">EGL_BAD_NATIVE_PIXMAP</code> may be generated if 221 <em class="parameter"><code>native_pixmap</code></em> is not a valid native pixmap. 222 </p> 223 <p> 224 <code class="constant">EGL_BAD_ATTRIBUTE</code> is generated if 225 <em class="parameter"><code>attrib_list</code></em> contains an invalid pixmap attribute 226 or if an attribute value is not recognized or out of range. 227 </p> 228 <p> 229 <code class="constant">EGL_BAD_ALLOC</code> is generated if there are not 230 enough resources to allocate the new surface. 231 </p> 232 <p> 233 <code class="constant">EGL_BAD_MATCH</code> is generated if the attributes of 234 <em class="parameter"><code>native_pixmap</code></em> do not correspond to 235 <em class="parameter"><code>config</code></em> or if 236 <em class="parameter"><code>config</code></em> does not support rendering to pixmaps 237 (the <code class="constant">EGL_SURFACE_TYPE</code> attribute does not contain 238 <code class="constant">EGL_PIXMAP_BIT</code>). 239 </p> 240 <p> 241 <code class="constant">EGL_BAD_MATCH</code> is generated if 242 <em class="parameter"><code>config</code></em> does not support the specified 243 OpenVG alpha format attribute (the value of 244 <code class="constant">EGL_VG_ALPHA_FORMAT</code> is 245 <code class="constant">EGL_VG_ALPHA_FORMAT_PRE</code> and the 246 <code class="constant">EGL_VG_ALPHA_FORMAT_PRE_BIT</code> is not set 247 in the <code class="constant">EGL_SURFACE_TYPE</code> attribute of 248 <em class="parameter"><code>config</code></em>) or colorspace attribute (the 249 value of <code class="constant">EGL_VG_COLORSPACE</code> is 250 <code class="constant">EGL_VG_COLORSPACE_LINEAR</code> and the 251 <code class="constant">EGL_VG_COLORSPACE_LINEAR_IT</code> is not set 252 in the <code class="constant">EGL_SURFACE_TYPE</code> attribute of 253 <em class="parameter"><code>config</code></em>). 254 </p> 255 </div> 256 <div class="refsect1" id="seealso"> 257 <h2>See Also</h2> 258 <p> 259 <a class="citerefentry" href="eglDestroySurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglDestroySurface</span></span></a>, 260 <a class="citerefentry" href="eglChooseConfig.xhtml"><span class="citerefentry"><span class="refentrytitle">eglChooseConfig</span></span></a>, 261 <a class="citerefentry" href="eglGetConfigs.xhtml"><span class="citerefentry"><span class="refentrytitle">eglGetConfigs</span></span></a>, 262 <a class="citerefentry" href="eglMakeCurrent.xhtml"><span class="citerefentry"><span class="refentrytitle">eglMakeCurrent</span></span></a>, 263 <a class="citerefentry" href="eglQuerySurface.xhtml"><span class="citerefentry"><span class="refentrytitle">eglQuerySurface</span></span></a> 264 </p> 265 </div> 266 <p> 267 </p> 268 <div class="refsect3" id="copyright"> 269 <img src="KhronosLogo.jpg"/> 270 <p> 271 Copyright © 2003-2014 The Khronos Group Inc. 272 Permission is hereby granted, free of charge, to any person obtaining a 273 copy of this software and/or associated documentation files (the 274 "Materials"), to deal in the Materials without restriction, including 275 without limitation the rights to use, copy, modify, merge, publish, 276 distribute, sublicense, and/or sell copies of the Materials, and to 277 permit persons to whom the Materials are furnished to do so, subject to 278 the condition that this copyright notice and permission notice shall be included 279 in all copies or substantial portions of the Materials. 280 </p> 281 </div> 282 <p> 283</p> 284 </div> 285 <footer/> 286 </body> 287</html> 288