GL_OES_EGL_image_external#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 1.x, 2.0, 3.x

Description#

This extension is similar to GL_OES_EGL_image, and allows formats not natively supported in the OpenGL ES API to be used as texture objects. Images bound in this way have restrictions to enable this, such as not being targetable by gl*Tex*Image*D functions, they can never be MIP mapped, and can only be sampled with the wrap mode GL_CLAMP_TO_EDGE. Images bound in this way use the texture target GL_TEXTURE_EXTERNAL_OES rather than GL_TEXTURE_2D etc., via the function glEGLImageTargetTexture2DOES. Sampling these textures will perform an implicit conversion from whatever format they are in to a linear RGB colour.

Example#

// Create an EGL image via EGL_KHR_image_base. In this case from an EGL pixmap (EGL_KHR_image_pixmap), but the source is irrelevant to this example
EGLImageKHR eglImage = eglCreateImageKHR(eglDisplay, eglContext, EGL_NATIVE_PIXMAP_KHR, (EGLNativeBuffer)eglPixmap, NULL);
// Generate a texture object to map the EGLImage to, and bind it.
GLint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture);
// Map the EGLImage into an OpenGL ES texture using this extension.
glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)eglImage);