Wednesday, May 25, 2011

eglCreatePbufferSurface example c c++ objc java


eglCreatePbufferSurface - create a new EGL pixel buffer surface

C Specification

EGLSurface eglCreatePbufferSurface(EGLDisplay display,
    EGLConfig config,
    EGLint const * attrib_list)


Specifies the EGL display connection.
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
Specifies the pixel buffer surface attributes. May be NULL or empty (first attribute is EGL_NONE). Accepted attributes are EGL_WIDTH, EGL_HEIGHT, and EGL_LARGEST_PBUFFER.


eglCreatePbufferSurface creates an off-screen pixel buffer surface and returns its handle. If eglCreatePbufferSurface fails to create a pixel buffer surface, EGL_NO_SURFACE is returned.
Any EGL rendering context that was created with respect to config can be used to render into the surface. Use eglMakeCurrent to attach an EGL rendering context to the surface.
Use eglQuerySurface to retrieve the dimensions of the allocated pixel buffer surface or the ID of config.
Use eglDestroySurface to destroy the surface.
The pixel buffer surface attributes are specified as a list of attribute value pairs, terminated with EGL_NONE. The accepted attributes for an EGL pixel buffer surface are:
Requests a pixel buffer surface with the specified width. The default value is 0.
Requests a pixel buffer surface with the specified height. The default value is 0.
Requests a pixel buffer surface with the largest width and height. Use eglQuerySurface to retrieve the dimensions of the allocated pixel buffer. Default value is EGL_FALSE.

Errors of eglCreatePbufferSurface

EGL_NO_SURFACE is returned if creation of the context fails.
EGL_BAD_DISPLAY is generated if display is not an EGL display connection.
EGL_NOT_INITIALIZED is generated if display has not been initialized.
EGL_BAD_CONFIG is generated if config is not an EGL frame buffer configuration.
EGL_BAD_ATTRIBUTE is generated if attrib_list contains an invalid pixel buffer attribute or if an attribute value is not recognized or out of range.
EGL_BAD_ALLOC is generated if there are not enough resources to allocate the new surface.
EGL_BAD_MATCH is generated if config does not support rendering to pixel buffers (the EGL_SURFACE_TYPE attribute does not contain EGL_PBUFFER_BIT).


Copyright © 2003 Silicon Graphics, Inc.
This document is licensed under the SGI Free Software B License. For details, see

See Also

eglDestroySurface, eglChooseConfig, eglGetConfigs, eglMakeCurrent, eglQuerySurface


iPBuffer = eglCreatePbufferSurface( iDisplay, iPConfig, attrib_list2 );
glGenTextures(1, &pbufferTex);
glBindTexture(GL_TEXTURE_2D, pbufferTex);
eglBindTexImage(iDisplay, iPBuffer, EGL_BACK_BUFFER);