Graphics Reference
In-Depth Information
Table 3-4
EGL Pixel Buffer Attributes
(continued)
Token
Description
Default Value
EGL_MIPMAP_TEXTURE
Specifies whether storage
for texture mipmap levels
(see Chapter 9, “Texturing”)
should be additionally
allocated. Valid values are
EGL_TRUE
and
EGL_FALSE
.
EGL_FALSE
There are a number of ways that
eglCreatePbufferSurface
could fail. Just
as with window creation, if any of these failures occur,
EGL_NO_SURFACE
is returned from the call and the particular error is set. In this situation,
eglGetError
will return one of the errors listed in Table 3-5.
Table 3-5
Possible Errors When
eglCreatePbufferSurface
Fails
Error Code
Description
EGL_BAD_ALLOC
This error occurs when the pbuffer cannot be allocated
due to a lack of resources.
EGL_BAD_CONFIG
This error is flagged if the provided
EGLConfig
is not a
valid
EGLConfig
supported by the system.
EGL_BAD_PARAMETER
This error is generated if either the
EGL_WIDTH
or
EGL_HEIGHT
provided in the attribute list is a negative value.
EGL_BAD_MATCH
This error is generated if any of the following
situations occur: if the
EGLConfig
provided does
not support pbuffer surfaces; if the pbuffer will be
used as a texture map (
EGL_TEXTURE_FORMAT
is not
EGL_NO_TEXTURE
), and the specified
EGL_WIDTH
and
EGL_HEIGHT
specify an invalid texture size; or if either
EGL_TEXTURE_FORMAT
and
EGL_TEXTURE_TARGET
is
EGL_NO_TEXTURE
, and the other attribute is not
EGL_NO_TEXTURE
.
EGL_BAD_
ATTRIBUTE
This error occurs if either
EGL_TEXTURE_FORMAT,
EGL_TEXTURE_TARGET
, or
EGL_MIPMAP_TEXTURE
is specified, but the provided
EGLConfig
does not
support OpenGL ES rendering (e.g., only OpenVG
rendering is supported).
Putting this all together, we create a pbuffer, as shown in Example 3-5.