public interface

EGL11

implements EGL10
javax.microedition.khronos.egl.EGL11

Class Overview

The EGL11 interface contains the Java(TM) programming language bindings for EGL 1.1. It extends the EGL10 interface.

The documentation in this interface is normative with respect to instance variable names and values, method names and signatures, and exception behavior. The remaining documentation is placed here for convenience and does not replace the normative documentation found in the EGL specification and relevant extension specifications. EGL documentation is available at the Khronos web site.

Summary

Constants
int EGL_BACK_BUFFER EGL 1.1 constant.
int EGL_BIND_TO_TEXTURE_RGB EGL 1.1 constant.
int EGL_BIND_TO_TEXTURE_RGBA EGL 1.1 constant.
int EGL_CONTEXT_LOST EGL 1.1 constant.
int EGL_MAX_SWAP_INTERVAL EGL 1.1 constant.
int EGL_MIN_SWAP_INTERVAL EGL 1.1 constant.
int EGL_MIPMAP_LEVEL EGL 1.1 constant.
int EGL_MIPMAP_TEXTURE EGL 1.1 constant.
int EGL_NO_TEXTURE EGL 1.1 constant.
int EGL_TEXTURE_2D EGL 1.1 constant.
int EGL_TEXTURE_FORMAT EGL 1.1 constant.
int EGL_TEXTURE_RGB EGL 1.1 constant.
int EGL_TEXTURE_RGBA EGL 1.1 constant.
int EGL_TEXTURE_TARGET EGL 1.1 constant.
[Expand]
Inherited Constants
From interface javax.microedition.khronos.egl.EGL10
[Expand]
Inherited Fields
From interface javax.microedition.khronos.egl.EGL10
Public Methods
abstract boolean eglBindTexImage(EGLDisplay display, EGLSurface surface, int buffer)
(EGL 1.1 only) Defines a two-dimensional texture image.
abstract boolean eglReleaseTexImage(EGLDisplay display, EGLSurface surface, int buffer)
(EGL 1.1 only) Releases a color buffer that is being used as a texture.
abstract boolean eglSurfaceAttrib(EGLDisplay display, EGLSurface surface, int attribute, int value)
(EGL 1.1 only) Set an EGL surface attribute.
abstract boolean eglSwapInterval(EGLDisplay display, int interval)
(EGL 1.1 only) Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context.
[Expand]
Inherited Methods
From interface javax.microedition.khronos.egl.EGL10

Constants

public static final int EGL_BACK_BUFFER

EGL 1.1 constant.

Constant Value: 12420 (0x00003084)

public static final int EGL_BIND_TO_TEXTURE_RGB

EGL 1.1 constant.

Constant Value: 12345 (0x00003039)

public static final int EGL_BIND_TO_TEXTURE_RGBA

EGL 1.1 constant.

Constant Value: 12346 (0x0000303a)

public static final int EGL_CONTEXT_LOST

EGL 1.1 constant.

Constant Value: 12302 (0x0000300e)

public static final int EGL_MAX_SWAP_INTERVAL

EGL 1.1 constant.

Constant Value: 12348 (0x0000303c)

public static final int EGL_MIN_SWAP_INTERVAL

EGL 1.1 constant.

Constant Value: 12347 (0x0000303b)

public static final int EGL_MIPMAP_LEVEL

EGL 1.1 constant.

Constant Value: 12419 (0x00003083)

public static final int EGL_MIPMAP_TEXTURE

EGL 1.1 constant.

Constant Value: 12418 (0x00003082)

public static final int EGL_NO_TEXTURE

EGL 1.1 constant.

Constant Value: 12380 (0x0000305c)

public static final int EGL_TEXTURE_2D

EGL 1.1 constant.

Constant Value: 12383 (0x0000305f)

public static final int EGL_TEXTURE_FORMAT

EGL 1.1 constant.

Constant Value: 12416 (0x00003080)

public static final int EGL_TEXTURE_RGB

EGL 1.1 constant.

Constant Value: 12381 (0x0000305d)

public static final int EGL_TEXTURE_RGBA

EGL 1.1 constant.

Constant Value: 12382 (0x0000305e)

public static final int EGL_TEXTURE_TARGET

EGL 1.1 constant.

Constant Value: 12417 (0x00003081)

Public Methods

public abstract boolean eglBindTexImage (EGLDisplay display, EGLSurface surface, int buffer)

(EGL 1.1 only) Defines a two-dimensional texture image.

The texture image consists of the image data in buffer for the specified surface, and need not be copied.

The texture target, the texture format and the size of the texture components are derived from attributes of the specified surface, which must be a pbuffer supporting one of the EGL_BIND_TO_TEXTURE_RGB or EGL_BIND_TO_TEXTURE_RGBA attributes.

The pbuffer attribute EGL_TEXTURE_FORMAT determines the base internal format of the texture.

The texture target is derived from the EGL_TEXTURE_TARGET attribute of surface. If the attribute value is EGL_TEXTURE_2D, then buffer defines a texture for the two-dimensional texture object which is bound to the current context (hereafter referred to as the current texture object).

If display and surface are the display and surface for the calling thread’s current context, eglBindTexImage performs an implicit glFlush. For other surfaces, eglBindTexImage waits for all effects from previously issued OpenGL ES commands drawing to the surface to complete before defining the texture image, as though glFinish were called on the last context to which that surface were bound.

After eglBindTexImage is called, the specified surface is no longer available for reading or writing. Any read operation, such as glReadPixels or eglCopyBuffers, which reads values from any of the surface’s color buffers or ancillary buffers will produce indeterminate results. In addition, draw operations that are done to the surface before its color buffer is released from the texture produce indeterminate results. Specifically, if the surface is current to a context and thread then rendering commands will be processed and the context state will be updated, but the surface may or may not be written.

Texture mipmap levels are automatically generated when all of the following conditions are met while calling eglBindTexImage:

The EGL_MIPMAP_TEXTURE attribute of the pbuffer being bound is EGL_TRUE.

The OpenGL ES texture parameter GL_GENERATE_MIPMAP is GL_TRUE for the currently bound texture.

The value of the EGL_MIPMAP_LEVEL attribute of the pbuffer being bound is equal to the value of the texture parameter GL_TEXTURE_BASE_LEVEL. In this case, additional mipmap levels are generated as described in section 3.8 of the OpenGL ES 1.1 Specification.

Notes

eglSwapBuffers has no effect if it is called on a bound surface.

Any existing images associated with the different mipmap levels of the texture object are freed (it is as if glTexImage was called with an image of zero width).

The color buffer is bound to a texture object. If the texture object is shared between contexts, then the color buffer is also shared. If a texture object is deleted before eglReleaseTexImage is called, then the color buffer is released and the surface is made available for reading and writing.

It is not an error to call glTexImage2D or glCopyTexImage2D to replace an image of a texture object that has a color buffer bound to it. However, these calls will cause the color buffer to be released back to the surface and new memory will be allocated for the texture. Note that the color buffer is released even if the image that is being defined is a mipmap level that was not defined by the color buffer.

eglBindTexImage is ignored if there is no current rendering context.

Errors

EGL_BAD_MATCH is generated if the surface attribute EGL_TEXTURE_FORMAT is set to EGL_NO_TEXTURE.

EGL_BAD_ACCESS is generated if buffer is already bound to a texture.

EGL_BAD_VALUE is generated if buffer is not a valid buffer (currently only EGL_BACK_BUFFER may be specified).

EGL_BAD_SURFACE is generated if surface is not an EGL surface, or is not a pbuffer surface supporting texture binding.

Parameters
display Specifies the EGL display connection.
surface Specifies the EGL surface.
buffer Specifies the texture image data.
Returns
  • true if the operation succeeds.
Throws
IllegalArgumentException if display is null.
IllegalArgumentException if surface is null.

public abstract boolean eglReleaseTexImage (EGLDisplay display, EGLSurface surface, int buffer)

(EGL 1.1 only) Releases a color buffer that is being used as a texture.

The specified color buffer is released back to the surface. The surface is made available for reading and writing when it no longer has any color buffers bound as textures.

Notes

If the specified color buffer is no longer bound to a texture (e.g., because the texture object was deleted) then eglReleaseTexImage has no effect. No error is generated.

The contents of the color buffer are undefined when it is first released. In particular, there is no guarantee that the texture image is still present. However, the contents of other color buffers are unaffected by this call. Also, the contents of the depth and stencil buffers are not affected by eglBindTexImage and eglReleaseTexImage.

After a color buffer is released from a texture (either explicitly by calling eglReleaseTexImage or implicitly by calling a routine such as glTexImage2D), all texture images that were defined by the color buffer become NULL (it is as if glTexImage was called with an image of zero width).

Errors

EGL_BAD_MATCH is generated if the surface attribute EGL_TEXTURE_FORMAT is set to EGL_NO_TEXTURE.

EGL_BAD_VALUE is generated if buffer is not a valid buffer (currently only EGL_BACK_BUFFER may be specified).

EGL_BAD_SURFACE is generated if surface is not an EGL surface, or is not a bound pbuffer surface.

Parameters
display Specifies the EGL display connection.
surface Specifies the EGL surface.
buffer Specifies the texture image data.
Returns
  • true if the operation succeeds.
Throws
IllegalArgumentException if display is null.
IllegalArgumentException if surface is null.

public abstract boolean eglSurfaceAttrib (EGLDisplay display, EGLSurface surface, int attribute, int value)

(EGL 1.1 only) Set an EGL surface attribute.

eglSurfaceAttrib sets the value of attribute for surface to value. attribute can be one of the following:

  • EGL_MIPMAP_LEVEL
  • For mipmap textures, the EGL_MIPMAP_LEVEL attribute indicates which level of the mipmap should be rendered. If the value of this attribute is outside the range of supported mipmap levels, the closest valid mipmap level is selected for rendering. The default value is 0.

Notes

If the value of pbuffer attribute EGL_TEXTURE_FORMAT is EGL_NO_TEXTURE, if the value of attribute EGL_TEXTURE_TYPE is EGL_NO_TEXTURE, or if surface is not a pbuffer, then attribute EGL_MIPMAP_LEVEL may be set, but has no effect.

Errors

false is returned on failure, true otherwise.

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_SURFACE is generated if surface is not an EGL surface.

EGL_BAD_ATTRIBUTE is generated if attribute is not a valid surface attribute.

Parameters
display Specifies the EGL display connection.
surface Specifies the EGL surface.
attribute Specifies the EGL surface attribute to set.
value Specifies the attributes required value.
Returns
  • true if the operation succeeds.
Throws
IllegalArgumentException if display is null.
IllegalArgumentException if surface is null.

public abstract boolean eglSwapInterval (EGLDisplay display, int interval)

(EGL 1.1 only) Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context.

The interval takes effect when eglSwapBuffers is first called subsequent to the eglSwapInterval call.

The interval specified by the function applies to the draw surface bound to the context that is current on the calling thread.

If interval is set to a value of 0, buffer swaps are not synchronized to a video frame, and the swap happens as soon as the render is complete. interval is silently clamped to minimum and maximum implementation dependent values before being stored; these values are defined by EGLConfig attributes EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL respectively.

Notes

The swap interval has no effect on eglCopyBuffers.

The default swap interval is 1.

Errors

false is returned on failure, true otherwise.

EGL_BAD_CONTEXT is generated if there is no current context on the calling thread.

EGL_BAD_SURFACE is generated if there is no surface bound to the current context.

Parameters
display Specifies the EGL display connection.
interval Specifies the minimum number of video frames that are displayed before a buffer swap will occur.
Returns
  • true if the operation succeeds.
Throws
IllegalArgumentException if display is null.