EGLSurface eglCreateWindowSurface( | EGLDisplay display, |
EGLConfig config, | |
NativeWindowType native_window, | |
EGLint const * attrib_list) ; |
Parameters
-
Specifies the EGL display connection.
-
Specifies the EGL frame buffer configuration that defines the frame buffer resource available to the surface.
-
Specifies the native window.
-
Specifies window surface attributes. May be
NULL
or empty (first attribute isEGL_NONE
).
display
config
native_window
attrib_list
Description
eglCreateWindowSurface
creates an EGL window surface and returns its handle. If eglCreateWindowSurface
fails to create a window surface, EGL_NO_SURFACE
is returned.
Surface attributes are specified as a list of attribute-value pairs, terminated with EGL_NONE
. Accepted attributes are:
-
Specifies which buffer should be used for client API rendering to the window. If its value is
EGL_SINGLE_BUFFER
, then client APIs should render directly into the visible window. If its value isEGL_BACK_BUFFER
, then client APIs should render into the back buffer. The default value ofEGL_RENDER_BUFFER
isEGL_BACK_BUFFER
.Client APIs may not be able to respect the requested rendering buffer. To determine the actual buffer being rendered to by a context, call eglQueryContext.
-
Specifies how alpha values are interpreted by OpenVG when rendering to the surface. If its value is
EGL_VG_ALPHA_FORMAT_NONPRE
, then alpha values are not premultipled. If its value isEGL_VG_ALPHA_FORMAT_PRE
, then alpha values are premultiplied. The default value ofEGL_VG_ALPHA_FORMAT
isEGL_VG_ALPHA_FORMAT_NONPRE
. -
Specifies the color space used by OpenVG when rendering to the surface. If its value is
EGL_VG_COLORSPACE_sRGB
, then a non-linear, perceptually uniform color space is assumed, with a corresponding VGImageFormat of formVG_s*
. If its value isEGL_VG_COLORSPACE_LINEAR
, then a linear color space is assumed, with a corresponding VGImageFormat of formVG_l*
. The default value ofEGL_VG_COLORSPACE
isEGL_VG_COLORSPACE_sRGB
.
EGL_RENDER_BUFFER
EGL_VG_ALPHA_FORMAT
EGL_VG_COLORSPACE
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 ID of config
.
Use eglDestroySurface to destroy the surface.