Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2007 Sun Microsystems, Inc. All rights reserved.

The Java™ Binding for the OpenGL® ES API

javax.microedition.khronos.egl
Interface EGL11

All Superinterfaces:
EGL, EGL10

public interface EGL11
extends EGL10

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.


Field Summary
static int EGL_BACK_BUFFER
          EGL 1.1 constant.
static int EGL_BIND_TO_TEXTURE_RGB
          EGL 1.1 constant.
static int EGL_BIND_TO_TEXTURE_RGBA
          EGL 1.1 constant.
static int EGL_CONTEXT_LOST
          EGL 1.1 constant.
static int EGL_MAX_SWAP_INTERVAL
          EGL 1.1 constant.
static int EGL_MIN_SWAP_INTERVAL
          EGL 1.1 constant.
static int EGL_MIPMAP_LEVEL
          EGL 1.1 constant.
static int EGL_MIPMAP_TEXTURE
          EGL 1.1 constant.
static int EGL_NO_TEXTURE
          EGL 1.1 constant.
static int EGL_TEXTURE_2D
          EGL 1.1 constant.
static int EGL_TEXTURE_FORMAT
          EGL 1.1 constant.
static int EGL_TEXTURE_RGB
          EGL 1.1 constant.
static int EGL_TEXTURE_RGBA
          EGL 1.1 constant.
static int EGL_TEXTURE_TARGET
          EGL 1.1 constant.
 
Fields inherited from interface javax.microedition.khronos.egl.EGL10
EGL_ALPHA_SIZE, EGL_BAD_ACCESS, EGL_BAD_ALLOC, EGL_BAD_ATTRIBUTE, EGL_BAD_CONFIG, EGL_BAD_CONTEXT, EGL_BAD_CURRENT_SURFACE, EGL_BAD_DISPLAY, EGL_BAD_MATCH, EGL_BAD_NATIVE_PIXMAP, EGL_BAD_NATIVE_WINDOW, EGL_BAD_PARAMETER, EGL_BAD_SURFACE, EGL_BLUE_SIZE, EGL_BUFFER_SIZE, EGL_CONFIG_CAVEAT, EGL_CONFIG_ID, EGL_CORE_NATIVE_ENGINE, EGL_DEFAULT_DISPLAY, EGL_DEPTH_SIZE, EGL_DONT_CARE, EGL_DRAW, EGL_EXTENSIONS, EGL_FALSE, EGL_GREEN_SIZE, EGL_HEIGHT, EGL_LARGEST_PBUFFER, EGL_LEVEL, EGL_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_PIXELS, EGL_MAX_PBUFFER_WIDTH, EGL_NATIVE_RENDERABLE, EGL_NATIVE_VISUAL_ID, EGL_NATIVE_VISUAL_TYPE, EGL_NO_CONTEXT, EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NON_CONFORMANT_CONFIG, EGL_NONE, EGL_NOT_INITIALIZED, EGL_PBUFFER_BIT, EGL_PIXMAP_BIT, EGL_PRESERVED_RESOURCES, EGL_READ, EGL_RED_SIZE, EGL_SAMPLE_BUFFERS, EGL_SAMPLES, EGL_SLOW_CONFIG, EGL_STENCIL_SIZE, EGL_SUCCESS, EGL_SURFACE_TYPE, EGL_TRANSPARENT_BLUE_VALUE, EGL_TRANSPARENT_GREEN_VALUE, EGL_TRANSPARENT_RED_VALUE, EGL_TRANSPARENT_RGB, EGL_TRANSPARENT_TYPE, EGL_TRUE, EGL_VENDOR, EGL_VERSION, EGL_WIDTH, EGL_WINDOW_BIT
 
Method Summary
 boolean eglBindTexImage(EGLDisplay display, EGLSurface surface, int buffer)
          (EGL 1.1 only) Defines a two-dimensional texture image.
 boolean eglReleaseTexImage(EGLDisplay display, EGLSurface surface, int buffer)
          (EGL 1.1 only) Releases a color buffer that is being used as a texture.
 boolean eglSurfaceAttrib(EGLDisplay display, EGLSurface surface, int attribute, int value)
          (EGL 1.1 only) Set an EGL surface attribute.
 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.
 
Methods inherited from interface javax.microedition.khronos.egl.EGL10
eglChooseConfig, eglCopyBuffers, eglCreateContext, eglCreatePbufferSurface, eglCreatePixmapSurface, eglCreateWindowSurface, eglDestroyContext, eglDestroySurface, eglGetConfigAttrib, eglGetConfigs, eglGetCurrentContext, eglGetCurrentDisplay, eglGetCurrentSurface, eglGetDisplay, eglGetError, eglInitialize, eglMakeCurrent, eglQueryContext, eglQueryString, eglQuerySurface, eglSwapBuffers, eglTerminate, eglWaitGL, eglWaitNative
 

Field Detail

EGL_CONTEXT_LOST

public static final int EGL_CONTEXT_LOST
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_BIND_TO_TEXTURE_RGB

public static final int EGL_BIND_TO_TEXTURE_RGB
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_BIND_TO_TEXTURE_RGBA

public static final int EGL_BIND_TO_TEXTURE_RGBA
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_MIN_SWAP_INTERVAL

public static final int EGL_MIN_SWAP_INTERVAL
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_MAX_SWAP_INTERVAL

public static final int EGL_MAX_SWAP_INTERVAL
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_NO_TEXTURE

public static final int EGL_NO_TEXTURE
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_TEXTURE_RGB

public static final int EGL_TEXTURE_RGB
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_TEXTURE_RGBA

public static final int EGL_TEXTURE_RGBA
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_TEXTURE_2D

public static final int EGL_TEXTURE_2D
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_TEXTURE_FORMAT

public static final int EGL_TEXTURE_FORMAT
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_TEXTURE_TARGET

public static final int EGL_TEXTURE_TARGET
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_MIPMAP_TEXTURE

public static final int EGL_MIPMAP_TEXTURE
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_MIPMAP_LEVEL

public static final int EGL_MIPMAP_LEVEL
EGL 1.1 constant.

See Also:
Constant Field Values

EGL_BACK_BUFFER

public static final int EGL_BACK_BUFFER
EGL 1.1 constant.

See Also:
Constant Field Values
Method Detail

eglSurfaceAttrib

public 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:

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:
java.lang.IllegalArgumentException - if display is null.
java.lang.IllegalArgumentException - if surface is null.

eglBindTexImage

public 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:
java.lang.IllegalArgumentException - if display is null.
java.lang.IllegalArgumentException - if surface is null.

eglReleaseTexImage

public 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:
java.lang.IllegalArgumentException - if display is null.
java.lang.IllegalArgumentException - if surface is null.

eglSwapInterval

public 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:
java.lang.IllegalArgumentException - if display is null.

Final Release, Oct 2006

This specification is protected under the JSPA version 2.6.
Copyright © 2006 Sun Microsystems, Inc. 4150 Network Circle, California, 95054, U.S.A.
All Rights Reserved. Use is subject to license terms.
Copyright © 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 239 specification.