| javax.microedition.khronos.egl.EGL10
All known Subclasses: javax.microedition.khronos.egl.EGL10Impl,
EGL10 | public interface EGL10 extends EGL(Code) | | The EGL10 interface contains the Java(TM) programming language
bindings for EGL 1.0.
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.
Extensions may return values or allow arguments to take on
values other than those listed in this specification.
Implementations that provide a given extension must pass such values
to and from the underlying engine.
If a method throws an exception, the state of the underlying EGL
engine is left intact.
All OpenGL ES drawing (except to Pbuffer surfaces) must be
preceded by a call to
eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, target)
where target is a platform-specific object describing
the rendering target,
and followed by a call to eglWaitGL() . Between these
calls, the results of calls or calls to any other drawing API, such
as MIDP, JSR 184, java.awt , etc., are undefined. When
drawing to an image, the results are not guaranteed to appear in
the image pixels until eglWaitGL has returned.
It is not required that calls to methods of this interface be
mapped one-to-one onto calls to functions in the underlying EGL
implementation. Implementations may contain logic to manage
configurations, drawing surface access, threading issues, etc., as
required in order to integrate EGL-based APIs with other platform
drawing APIs. For example, an implementation that makes use of a
software back buffer may translate a call to
EGL10.eglCreateWindowSurface into a call to the native
function eglCreatePixmapSurface targetting the
buffer. Naturally, hardware-accelerated implementations should
endeavor to avoid such workarounds.
Drawing to a Pbuffer
A Pbuffer is an invisible, possibly hardware-accelerated
buffer. Pbuffer surfaces are created using the
EGL10.eglCreatePbufferSurface method. Pbuffers are
accessible only from EGL-based APIs, and follow the rules set out
in the EGL specification. Pbuffers may be used in the same manner
on any Java platform.
The integration between EGL and specific Java ME platforms is as
follows.
CLDC/MIDP
On the CLDC/MIDP platform, drawing can be performed to four
types of targets: javax.microedition.lcdui.Canvas ,
javax.microedition.lcdui.game.GameCanvas , (mutable)
javax.microedition.lcdui.Image ,
or to a
Pbuffer.
The EGL_DEFAULT_DISPLAY token is used to
specify a display.
Drawing to a Canvas or GameCanvas
A Canvas or GameCanvas is specified
as a drawing target using the eglCreateWindowSurface
method. The native_window argument must be an
instance of javax.microedition.lcdui.Graphics that was
obtained directly from the argument to the
Canvas.paint() method or from the
GameCanvas.getGraphics() method. A
Graphics instance obtained from the argument to
Canvas.paint may be reused in subsequent
paint calls targeting the same Canvas .
Drawing to a Canvas or GameCanvas
allows for mixing of different drawing APIs.
When drawing to a Canvas (that is not a
GameCanvas ), drawing must take place entirely within
the scope of a system-generated call to the Canvas 's
paint(Graphics) method. The results of drawing to a
Canvas outside the scope of such a call are undefined.
Calling eglSwapBuffers is equivalent to calling
glFinish , and does not affect the screen output. The
normal GameCanvas.flushGraphics method is used to
control screen output.
The initial contents of the back buffer for a
GameCanvas are initialized to white, and calls to
flushGraphics do not alter the buffer contents.
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.midlet.MIDlet;
import javax.microedition.khronos.egl.*;
import javax.microedition.khronos.opengles.*;
class MyGameCanvas extends GameCanvas {
EGL11 egl;
GL11 gl;
Graphics midpGraphics;
javax.microedition.m3g.Graphics3D m3gContext;
MyGameCanvas(MIDlet thisMIDlet) {
// This example doesn't require key events
super(true);
// Get a Graphics instance for MIDP rendering
// and to use in createWindowSurface
this.midpGraphics = getGraphics();
// Show this GameCanvas on the display
Display display = Display.getDisplay(thisMIDlet);
display.setCurrent(this);
// Create an EGL instance
this.egl = (EGL11)EGLContext.getEGL();
// Get the EGL display object and initialize EGL
EGLDisplay eglDisplay = egl.eglGetDisplay(EGL11.EGL_DEFAULT_DISPLAY);
int[] major_minor = new int[2];
egl.eglInitialize(eglDisplay, major_minor);
System.out.println("EGL revision: major = " + major_minor[0]);
System.out.println("EGL revision: minor = " + major_minor[1]);
// Determine the number of available configurations
int[] num_config = new int[1];
egl.eglGetConfigs(eglDisplay, null, 0, num_config);
System.out.println("There are " + num_config[0] + " configurations");
// Locate an 8/8/8 RGB configuration
int[] configAttrs = { EGL11.EGL_RED_SIZE, 8,
EGL11.EGL_GREEN_SIZE, 8,
EGL11.EGL_BLUE_SIZE, 8,
EGL11.EGL_ALPHA_SIZE, EGL11.EGL_DONT_CARE,
EGL11.EGL_DEPTH_SIZE, EGL11.EGL_DONT_CARE,
EGL11.EGL_STENCIL_SIZE, EGL11.EGL_DONT_CARE,
EGL11.EGL_NONE
};
// Grab the first matching config
EGLConfig[] eglConfigs = new EGLConfig[1];
egl.eglChooseConfig(eglDisplay, configAttrs,
eglConfigs, 1, num_config);
EGLConfig eglConfig = eglConfigs[0];
// Get a context for EGL rendering
EGLContext eglContext =
egl.eglCreateContext(eglDisplay, eglConfig,
EGL11.EGL_NO_CONTEXT, null);
// Get a GL object for rendering
this.gl = (GL11)eglContext.getGL();
// Bind a window surface to the context
EGLSurface eglSurface =
egl.eglCreateWindowSurface(eglDisplay, eglConfig, midpGraphics, null);
// Make the context current for future GL calls
egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
// Get a context for M3G rendering
this.m3g = ...;
}
// The update loop
public void run() {
while (true) {
// Do some MIDP 2D rendering
// Use of OpenGL ES or M3G is not allowed here
// MIDP primitives drawn here will appear underneath the
// OpenGL ES drawing
midpGraphics.drawLine(...);
// Wait for MIDP drawing to complete
egl.eglWaitNative(EGL11.EGL_CORE_NATIVE_ENGINE, midpGraphics);
// Now it is O.K. to use OpenGL ES drawing APIs
// Do some OpenGL ES rendering
// Use of MIDP, JSR 184, or other drawing APIs is undefined here
gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
gl.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
gl.glFrustumf(...);
// etc.
// Wait for OpenGL ES rendering to complete
egl.eglWaitGL();
// Now it is O.K. to use MIDP drawing APIs
// MIDP primitives drawn here will appear on top of the
// OpenGL ES drawing
midpGraphics.drawRect(...);
// Do some M3G (JSR 184) rendering
m3g.bindTarget(midpGraphics, ...);
// Now it is O.K. to use M3G, but not MIDP or OpenGL ES
// M3G commands go here
// Wait for M3G drawing to complete
m3g.releaseTarget();
// Now it is O.K. to use MIDP drawing APIs
// Do some more MIDP 2D rendering
// MIDP primitives drawn here will appear on top of the
// OpenGL ES and M3G drawings
midp_graphics.drawArc(...);
// Flush the back buffer to the screen
flushGraphics();
}
}
}
Drawing to an Image
The eglCreatePixmapSurface method allows drawing
to an Image . The Image must be mutable.
The native_pixmap argument must be an instance of
javax.microedition.lcdui.Graphics that was obtained
from the Image 's getGraphics() method.
OpenGL ES drawing must be bracketed between calls to
eglWaitNative and eglWaitGL in the same
manner as for Canvas and GameCanvas .
Calling eglSwapBuffers is equivalent to calling
glFinish , since there is no back buffer.
Other platforms
The current specification does not address AWT-based platforms
such as CDC/Personal Basis Profile, CDC/Personal Profile,
and Java Standard Edition. The details of how to bind to displays
and surfaces on these platforms will be provided in a future release
of the specification.
|
Field Summary | |
final public static int | EGL_ALPHA_SIZE EGLConfig attribute name. | final public static int | EGL_BAD_ACCESS EGL error code indicating 'bad access'. | final public static int | EGL_BAD_ALLOC EGL error code indicating 'bad alloc'. | final public static int | EGL_BAD_ATTRIBUTE EGL error code indicating 'bad attribute'. | final public static int | EGL_BAD_CONFIG EGL error code indicating 'bad config'. | final public static int | EGL_BAD_CONTEXT EGL error code indicating 'bad context'. | final public static int | EGL_BAD_CURRENT_SURFACE EGL error code indicating 'bad current surface'. | final public static int | EGL_BAD_DISPLAY EGL error code indicating 'bad display'. | final public static int | EGL_BAD_MATCH EGL error code indicating 'bad match'. | final public static int | EGL_BAD_NATIVE_PIXMAP EGL error code indicating 'bad native pixmap'. | final public static int | EGL_BAD_NATIVE_WINDOW EGL error code indicating 'bad native window'. | final public static int | EGL_BAD_PARAMETER EGL error code indicating 'bad parameter'. | final public static int | EGL_BAD_SURFACE EGL error code indicating 'bad surface'. | final public static int | EGL_BLUE_SIZE EGLConfig attribute name. | final public static int | EGL_BUFFER_SIZE EGLConfig attribute name. | final public static int | EGL_CONFIG_CAVEAT EGLConfig attribute name. | final public static int | EGL_CONFIG_ID EGLConfig attribute name. | final public static int | EGL_CORE_NATIVE_ENGINE Constant for use as the engine argument of
eglWaitNative , indicating the core native engine of
the platform.
On a JME CLDC/MIDP platform, this specifies the MIDP/LCDUI
drawing engine.
|
EGL_DEFAULT_DISPLAY | final public static Object EGL_DEFAULT_DISPLAY(Code) | | An object that is used as an argument to
eglGetDisplay to indicate that the defalt display of
the device is to be used.
|
EGL_DEPTH_SIZE | final public static int EGL_DEPTH_SIZE(Code) | | EGLConfig attribute name.
|
EGL_DONT_CARE | final public static int EGL_DONT_CARE(Code) | | EGLConfig attribute value.
|
EGL_DRAW | final public static int EGL_DRAW(Code) | | Constant for use in the readdraw argument of
getCurrentSurface .
|
EGL_EXTENSIONS | final public static int EGL_EXTENSIONS(Code) | | Constant for use in eglQueryString .
|
EGL_FALSE | final public static int EGL_FALSE(Code) | | A value corresponding to the 'EGLBoolean' false value.
|
EGL_GREEN_SIZE | final public static int EGL_GREEN_SIZE(Code) | | EGLConfig attribute name.
|
EGL_HEIGHT | final public static int EGL_HEIGHT(Code) | | EGLSurface attribute name.
|
EGL_LARGEST_PBUFFER | final public static int EGL_LARGEST_PBUFFER(Code) | | EGLSurface attribute name.
|
EGL_LEVEL | final public static int EGL_LEVEL(Code) | | EGLConfig attribute name.
|
EGL_MAX_PBUFFER_HEIGHT | final public static int EGL_MAX_PBUFFER_HEIGHT(Code) | | EGLConfig attribute name.
|
EGL_MAX_PBUFFER_PIXELS | final public static int EGL_MAX_PBUFFER_PIXELS(Code) | | EGLConfig attribute name.
|
EGL_MAX_PBUFFER_WIDTH | final public static int EGL_MAX_PBUFFER_WIDTH(Code) | | EGLConfig attribute name.
|
EGL_NATIVE_RENDERABLE | final public static int EGL_NATIVE_RENDERABLE(Code) | | EGLConfig attribute name.
|
EGL_NATIVE_VISUAL_ID | final public static int EGL_NATIVE_VISUAL_ID(Code) | | EGLConfig attribute name.
|
EGL_NATIVE_VISUAL_TYPE | final public static int EGL_NATIVE_VISUAL_TYPE(Code) | | EGLConfig attribute name.
|
EGL_NONE | final public static int EGL_NONE(Code) | | EGLConfig attribute name and value.
|
EGL_NON_CONFORMANT_CONFIG | final public static int EGL_NON_CONFORMANT_CONFIG(Code) | | EGLConfig attribute value.
|
EGL_NOT_INITIALIZED | final public static int EGL_NOT_INITIALIZED(Code) | | EGL error code indicating 'not initialized'.
|
EGL_NO_CONTEXT | final public static EGLContext EGL_NO_CONTEXT(Code) | | An EGLContext object used to indicate a null context.
|
EGL_NO_DISPLAY | final public static EGLDisplay EGL_NO_DISPLAY(Code) | | An EGLContext object used to indicate a null display.
|
EGL_NO_SURFACE | final public static EGLSurface EGL_NO_SURFACE(Code) | | An EGLContext object used to indicate a null surface.
|
EGL_PBUFFER_BIT | final public static int EGL_PBUFFER_BIT(Code) | | EGLConfig attribute value.
|
EGL_PIXMAP_BIT | final public static int EGL_PIXMAP_BIT(Code) | | EGLConfig attribute value.
|
EGL_PRESERVED_RESOURCES | final public static int EGL_PRESERVED_RESOURCES(Code) | | EGLConfig attribute name.
|
EGL_READ | final public static int EGL_READ(Code) | | Constant for use as the readdraw argument of
getCurrentSurface .
|
EGL_RED_SIZE | final public static int EGL_RED_SIZE(Code) | | EGLConfig attribute name.
|
EGL_SAMPLES | final public static int EGL_SAMPLES(Code) | | EGLConfig attribute name.
|
EGL_SAMPLE_BUFFERS | final public static int EGL_SAMPLE_BUFFERS(Code) | | EGLConfig attribute name.
|
EGL_SLOW_CONFIG | final public static int EGL_SLOW_CONFIG(Code) | | EGLConfig attribute value.
|
EGL_STENCIL_SIZE | final public static int EGL_STENCIL_SIZE(Code) | | EGLConfig attribute name.
|
EGL_SUCCESS | final public static int EGL_SUCCESS(Code) | | EGL error code indicating success.
|
EGL_SURFACE_TYPE | final public static int EGL_SURFACE_TYPE(Code) | | EGLConfig attribute name.
|
EGL_TRANSPARENT_BLUE_VALUE | final public static int EGL_TRANSPARENT_BLUE_VALUE(Code) | | EGLConfig attribute name.
|
EGL_TRANSPARENT_GREEN_VALUE | final public static int EGL_TRANSPARENT_GREEN_VALUE(Code) | | EGLConfig attribute name.
|
EGL_TRANSPARENT_RED_VALUE | final public static int EGL_TRANSPARENT_RED_VALUE(Code) | | EGLConfig attribute name.
|
EGL_TRANSPARENT_RGB | final public static int EGL_TRANSPARENT_RGB(Code) | | EGLConfig attribute value.
|
EGL_TRANSPARENT_TYPE | final public static int EGL_TRANSPARENT_TYPE(Code) | | EGLConfig attribute name.
|
EGL_TRUE | final public static int EGL_TRUE(Code) | | A value corresponding to the 'EGLBoolean' true value.
|
EGL_VENDOR | final public static int EGL_VENDOR(Code) | | Constant for use in eglQueryString .
|
EGL_VERSION | final public static int EGL_VERSION(Code) | | Constant for use in eglQueryString .
|
EGL_WIDTH | final public static int EGL_WIDTH(Code) | | EGLSurface attribute name.
|
EGL_WINDOW_BIT | final public static int EGL_WINDOW_BIT(Code) | | EGLConfig attribute value.
|
eglChooseConfig | boolean eglChooseConfig(EGLDisplay display, int[] attrib_list, EGLConfig[] configs, int config_size, int[] num_config)(Code) | | Return a list of EGL frame buffer configurations that match
specified attributes.
eglChooseConfig returns a list of all EGL frame
buffer configurations that match the attributes specified in
attrib_list . The items in the list can be used in
any EGL function that requires an EGL frame buffer configuration.
configs does not return values, if it is specified
as null . This is useful for querying just the number
of matching frame buffer configurations.
All attributes in attrib_list , including boolean
attributes, are immediately followed by the corresponding desired
value. The list is terminated with EGL_NONE . If an
attribute is not specified in attrib_list then the
default value (see below) is used (and the attribute is said to
be specified implicitly). For example, if
EGL_DEPTH_SIZE is not specified then it is assumed
to be 0. For some attributes, the default is
EGL_DONT_CARE meaning that any value is OK for this
attribute, so the attribute will not be checked.
If attrib_list is null or empty
(first attribute is EGL_NONE ), then selection and
sorting of EGLConfig s is done according to the
default criteria described below.
Attributes are matched in an attribute-specific manner. Some of
the attributes, such as EGL_LEVEL , must match the
specified value exactly. Others, such as,
EGL_RED_SIZE must meet or exceed the specified
minimum values. If more than one EGL frame buffer configuration
is found, then a list of configurations, sorted according to the
"best" match criteria, is returned. The match criteria for each
attribute and the exact sorting order is defined below.
The interpretations of the various EGL frame buffer configuration
attributes are as follows:
EGL_BUFFER_SIZE
Must be followed by a nonnegative integer that indicates the
desired color buffer size. The smallest color buffer of at least
the specified size is preferred. The default value is 0.
EGL_RED_SIZE
Must be followed by a nonnegative minimum size specification. If
this value is zero, the smallest available red buffer is
preferred. Otherwise, the largest available red buffer of at
least the minimum size is preferred. The default value is 0.
EGL_GREEN_SIZE
Must be followed by a nonnegative minimum size specification. If
this value is zero, the smallest available green buffer is
preferred. Otherwise, the largest available green buffer of at
least the minimum size is preferred. The default value is 0.
EGL_BLUE_SIZE
Must be followed by a nonnegative minimum size specification. If
this value is zero, the smallest available blue buffer is
preferred. Otherwise, the largest available blue buffer of at
least the minimum size is preferred. The default value is 0.
EGL_ALPHA_SIZE
Must be followed by a nonnegative minimum size specification. If
this value is zero, the smallest available alpha buffer is
preferred. Otherwise, the largest available alpha buffer of at
least the minimum size is preferred. The default value is 0.
EGL_CONFIG_CAVEAT
Must be followed by one of EGL_DONT_CARE ,
EGL_NONE , EGL_SLOW_CONFIG ,
EGL_NON_CONFORMANT_CONFIG . If EGL_NONE
is specified, then only frame buffer configurations with no
caveats will be considered. If EGL_SLOW_CONFIG is
specified, then only slow frame buffer configurations will be
considered. If EGL_NON_CONFORMANT_CONFIG is
specified, then only non-conformant frame buffer configurations
will be considered. The default value is
EGL_DONT_CARE .
EGL_CONFIG_ID
Must be followed by a valid ID that indicates the desired EGL
frame buffer configuration. When a EGL_CONFIG_ID is
specified, all attributes are ignored. The default value is
EGL_DONT_CARE .
EGL_DEPTH_SIZE
Must be followed by a nonnegative integer that indicates the
desired depth buffer size. The smallest available depth buffer of
at least the minimum size is preferred. If the desired value is
zero, frame buffer configurations with no depth buffer are
preferred. The default value is 0.
EGL_LEVEL
Must be followed by an integer buffer-level specification. This
specification is honored exactly. Buffer level 0 corresponds to
the default frame buffer of the display. Buffer level 1 is the
first overlay frame buffer, level two the second overlay frame
buffer, and so on. Negative buffer levels correspond to underlay
frame buffers. The default value is 0.
EGL_NATIVE_RENDERABLE
Must be followed by EGL_DONT_CARE ,
EGL_TRUE , or EGL_FALSE . If
EGL_TRUE is specified, then only frame buffer
configurations that allow native rendering into the surface will
be considered. The default value is EGL_DONT_CARE .
EGL_NATIVE_VISUAL_TYPE (1.0 only)
Must be followed by a platform dependent value or
EGL_DONT_CARE . The default value is
EGL_DONT_CARE .
EGL_SAMPLE_BUFFERS
Must be followed by the minimum acceptable number of multisample
buffers. Configurations with the smallest number of multisample
buffers that meet or exceed this minimum number are
preferred. Currently operation with more than one multisample
buffer is undefined, so only values of zero or one will produce a
match. The default value is 0.
EGL_SAMPLES
Must be followed by the minimum number of samples required in
multisample buffers. Configurations with the smallest number of
samples that meet or exceed the specified minimum number are
preferred. Note that it is possible for color samples in the
multisample buffer to have fewer bits than colors in the main
color buffers. However, multisampled colors maintain at least as
much color resolution in aggregate as the main color buffers.
EGL_STENCIL_SIZE
Must be followed by a nonnegative integer that indicates the
desired number of stencil bitplanes. The smallest stencil buffer
of at least the specified size is preferred. If the desired value
is zero, frame buffer configurations with no stencil buffer are
preferred. The default value is 0.
EGL_SURFACE_TYPE
Must be followed by a mask indicating which EGL surface types
the frame buffer configuration must support. Valid bits are
EGL_WINDOW_BIT , EGL_PBUFFER_BIT , and
EGL_PIXMAP_BIT . For example, if mask is
set to EGL_WINDOW_BIT | EGL_PIXMAP_BIT ,
only frame buffer configurations that support both windows and
pixmaps will be considered. The default value is
EGL_WINDOW_BIT .
EGL_TRANSPARENT_TYPE
Must be followed by one of EGL_NONE or
EGL_TRANSPARENT_RGB . If EGL_NONE is
specified, then only opaque frame buffer configurations will be
considered. If EGL_TRANSPARENT_RGB is specified,
then only transparent frame buffer configurations will be
considered. The default value is EGL_NONE .
EGL_TRANSPARENT_RED_VALUE
Must be followed by an integer value indicating the transparent
red value. The value must be between 0 and the maximum color
buffer value for red. Only frame buffer configurations that use
the specified transparent red value will be considered. The
default value is EGL_DONT_CARE .
This attribute is ignored unless
EGL_TRANSPARENT_TYPE is included in
attrib_list and specified as
EGL_TRANSPARENT_RGB .
EGL_TRANSPARENT_GREEN_VALUE
Must be followed by an integer value indicating the transparent
green value. The value must be between 0 and the maximum color
buffer value for red. Only frame buffer configurations that use
the specified transparent green value will be considered. The
default value is EGL_DONT_CARE .
This attribute is ignored unless
EGL_TRANSPARENT_TYPE is included in
attrib_list and specified as
EGL_TRANSPARENT_RGB .
EGL_TRANSPARENT_BLUE_VALUE
Must be followed by an integer value indicating the transparent
blue value. The value must be between 0 and the maximum color
buffer value for red. Only frame buffer configurations that use
the specified transparent blue value will be considered. The
default value is EGL_DONT_CARE .
This attribute is ignored unless
EGL_TRANSPARENT_TYPE is included in
attrib_list and specified as
EGL_TRANSPARENT_RGB .
EGL_BIND_TO_TEXTURE_RGB (1.1 only)
Must be followed by EGL_DONT_CARE ,
EGL_TRUE , or EGL_FALSE . If
EGL_TRUE is specified, then only frame buffer
configurations that support binding of color buffers to an RGB
texture will be considered. Currently only frame buffer
configurations that support pbuffers allow this. The default
value is EGL_DONT_CARE .
EGL_BIND_TO_TEXTURE_RGBA (1.1 only)>
Must be followed by EGL_DONT_CARE ,
EGL_TRUE , or EGL_FALSE . If
EGL_TRUE is specified, then only frame buffer
configurations that support binding of color buffers to an RGBA
texture will be considered. Currently only frame buffer
configurations that support pbuffers allow this. The default
value is EGL_DONT_CARE .
EGL_MAX_SWAP_INTERVAL (1.1 only)
Must be followed by a integer that indicates the maximum value
that can be passed to eglSwapInterval . The default
value is EGL_DONT_CARE .
EGL_MIN_SWAP_INTERVAL (1.1 only)
Must be followed by a integer that indicates the minimum value
that can be passed to eglSwapInterval . The default
value is EGL_DONT_CARE .
When more than one EGL frame buffer configuration matches the
specified attributes, a list of matching configurations is
returned. The list is sorted according to the following
precedence rules, which are applied in ascending order (i.e.,
configurations that are considered equal by a lower numbered rule
are sorted by the higher numbered rule):
- By
EGL_CONFIG_CAVEAT , where the precedence is
EGL_NONE , EGL_SLOW_CONFIG , and
EGL_NON_CONFORMANT_CONFIG .
- Larger total number of color components
(
EGL_RED_SIZE , EGL_GREEN_SIZE ,
EGL_BLUE_SIZE , and EGL_ALPHA_SIZE ) that
have higher number of bits. If the requested number of bits in
attrib_list is zero or EGL_DONT_CARE
for a particular color component, then the number of bits for
that component is not considered.
- Smaller
EGL_BUFFER_SIZE .
- Smaller
EGL_SAMPLE_BUFFERS .
- Smaller
EGL_SAMPLES .
- Smaller
EGL_DEPTH_SIZE .
- Smaller
EGL_STENCIL_SIZE .
- By
EGL_NATIVE_VISUAL_TYPE , where the precedence
order is platform dependent.
- Smaller
EGL_CONFIG_ID .
(1.1) EGLConfigs are not sorted with respect to the
parameters EGL_BIND_TO_TEXTURE_RGB ,
EGL_BIND_TO_TEXTURE_RGBA , EGL_LEVEL ,
EGL_NATIVE_RENDERABLE ,
EGL_MAX_SWAP_INTERVAL ,
EGL_MIN_SWAP_INTERVAL ,
EGL_SURFACE_TYPE , EGL_TRANSPARENT_TYPE ,
EGL_TRANSPARENT_RED_VALUE ,
EGL_TRANSPARENT_GREEN_VALUE , and
EGL_TRANSPARENT_BLUE_VALUE .
Examples
The following example specifies a frame buffer configuration in
the normal frame buffer (not an overlay or underlay). The
returned frame buffer configuration supports at least 4 bits each
of red, green and blue and possible no alpha bits. The code shown
in the example may or may not have a depth buffer, or a stencil
buffer.
int attrib_list[] = {
EGL10.EGL_RED_SIZE, 4,
EGL10.EGL_GREEN_SIZE, 4,
EGL10.EGL_BLUE_SIZE, 4,
EGL10.EGL_NONE
};
Notes
eglGetConfigs and eglGetConfigAttrib can be
used to implement selection algorithms other than the generic one
implemented by eglChooseConfig . Call
eglGetConfigs to retrieve all the frame buffer
configurations, or alternatively, all the frame buffer configurations
with a particular set of attributes. Next call
eglGetConfigAttrib to retrieve additional attributes for
the frame buffer configurations and then select between them.
EGL implementors are strongly discouraged, but not proscribed, from
changing the selection algorithm used by
eglChooseConfig . Therefore, selections may change from
release to release of the client-side library.
Errors
false is returned on failure, true
otherwise. configs and num_config are
not modified when false is returned.
EGL_BAD_DISPLAY is generated if
display is not an EGL display connection.
EGL_BAD_ATTRIBUTE is generated if
attribute_list contains an invalid frame buffer
configuration attribute or an attribute value that is
unrecognized or out of range.
EGL_NOT_INITIALIZED is generated if
display has not been initialized.
EGL_BAD_PARAMETER is generated if
num_config is null .
Parameters: display - Specifies the EGL display connection. Parameters: attrib_list - Specifies attributes required to match by configs. Parameters: configs - Returns an array of frame buffer configurations. Parameters: config_size - Specifies the size of the array of framebuffer configurations. Parameters: num_config - An int array in which the number of framebuffer configurations will be returned in element 0. true if the operation succeeds. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if attrib_list isnon-null but is not terminated withEGL_NONE . exception: IllegalArgumentException - if configs isnon-null and configs.length is smallerthan config_size . exception: IllegalArgumentException - if num_config isnon-null but has length less than 1.
|
eglCopyBuffers | boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface, Object native_pixmap)(Code) | | Copy EGL surface color buffer to a native pixmap.
eglCopyBuffers copies the color buffer of
surface to native_pixmap .
eglCopyBuffers performs an implicit
glFlush before it returns. Subsequent GL commands
may be issued immediately after calling
eglCopyBuffers , but are not executed until copying
of the color buffer is completed.
Notes
The color buffer of surface is left unchanged after calling
eglCopyBuffers .
On JME CLDC/MIDP platforms, native_pixmap must be
an instance of javax.microedition.lcdui.Image that
is mutable, or an instance of
javax.microedition.lcdui.Graphics
that was obtained directly from such
an image by means of a call to createGraphics() or
getGraphics() .
Errors
false is returned if swapping of the surface
buffers fails, 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 drawing surface.
EGL_BAD_NATIVE_PIXMAP is generated if the
implementation does not support native pixmaps.
EGL_BAD_NATIVE_PIXMAP may be generated if
native_pixmap is not a valid native pixmap.
EGL_BAD_MATCH is generated if the format of
native_pixmap is not compatible with the color
buffer of surface.
(1.1 only) EGL_CONTEXT_LOST is generated if a
power management event has occurred. The application must destroy
all contexts and reinitialize OpenGL ES state and objects to
continue rendering.
Parameters: display - Specifies the EGL display connection. Parameters: surface - Specifies the EGL surface whose color buffer is tobe copied. Parameters: native_pixmap - Specifies the native pixmap as target of thecopy. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if surface isnull . exception: IllegalArgumentException - if native_pixmap is null or is not of a suitable type for theunderlying platform (e.g., a mutable Image for CLDC/MIDP). true if the copy succeeds. |
eglCreateContext | EGLContext eglCreateContext(EGLDisplay display, EGLConfig config, EGLContext share_context, int[] attrib_list)(Code) | | Create a new EGL rendering context.
eglCreateContext creates an EGL rendering context
and returns its handle. This context can be used to render into
an EGL drawing surface. If eglCreateContext fails to
create a rendering context, EGL_NO_CONTEXT is
returned.
If share_context is not EGL_NO_CONTEXT ,
then all texture objects except object 0, are shared by context
share_context and by the newly created context. An
arbitrary number of rendering contexts can share a single texture
object space. However, all rendering contexts that share a single
texture object space must themselves exist in the same address
space. Two rendering contexts share an address space if both are
owned by a single process.
Currently no attributes are recognized, so
attrib_list will normally be null or
empty (first attribute is EGL_NONE ). However, it is
possible that some platforms will define attributes specific to
those environments, as an EGL extension. A non-null
attribute list that is terminated with EGL_NONE will
be passed to the underlying EGL implementation.
Errors
EGL_NO_CONTEXT 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_CONTEXT is generated if
share_context is not an EGL rendering context and is
not EGL_NO_CONTEXT .
EGL_BAD_ATTRIBUTE is generated if
attrib_list contains an invalid context attribute or
if an attribute is not recognized or out of range.
EGL_BAD_ALLOC is generated if there are not enough
resources to allocate the new context.
Parameters: display - Specifies the EGL display connection. Parameters: config - Specifies the EGL frame buffer configuration thatdefines the frame buffer resource available to the renderingcontext. Parameters: share_context - Specifies the EGL rendering context withwhich to share texture objects. EGL_NO_CONTEXT indicates that no sharing is to take place. Parameters: attrib_list - Specifies attributes. A new EGLContext , or null if context creation was unsuccessful. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if config isnull . exception: IllegalArgumentException - if share_context isnull . exception: IllegalArgumentException - if attrib_list isnon-null but is not terminated withEGL_NONE .
|
eglCreatePbufferSurface | EGLSurface eglCreatePbufferSurface(EGLDisplay display, EGLConfig config, int[] attrib_list)(Code) | | Create a new EGL pixel buffer surface.
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 in
attrib_list as a list of attribute value pairs,
terminated with EGL_NONE . A null value
for attrib_list is treated as an empty list. The
accepted attributes for an EGL pixel buffer surface are:
EGL_WIDTH
Specifies the requested width of the pixel buffer surface. The
default value is 0.
EGL_HEIGHT
Specifies the requests height of the pixel buffer surface. The
default value is 0.
EGL_LARGEST_PBUFFER
Requests the largest available pixel buffer surface when the
allocation would otherwise fail. Use eglQuerySurface
to retrieve the dimensions of the allocated pixel buffer. The
default value is EGL_FALSE .
EGL_TEXTURE_FORMAT (1.1 only)
Specifies the format of the texture that will be created when
a pbuffer is bound to a texture map. Possible values are
EGL_NO_TEXTURE , EGL_TEXTURE_RGB , and
EGL_TEXTURE_RGBA . The default value is
EGL_NO_TEXTURE .
EGL_TEXTURE_TARGET (1.1 only)
Specifies the target for the texture that will be created when
the pbuffer is created with a texture format of
EGL_TEXTURE_RGB or
EGL_TEXTURE_RGBA . Possible values are
EGL_NO_TEXTURE , or EGL_TEXTURE_2D . The
default value is EGL_NO_TEXTURE .
EGL_MIPMAP_TEXTURE (1.1 only)
Specifies whether storage for mipmaps should be allocated. Space
for mipmaps will be set aside if the attribute value is
EGL_TRUE and EGL_TEXTURE_FORMAT is not
EGL_NO_TEXTURE . The default value is
EGL_FALSE .
1.1 Notes
If the value of config attribute EGL_TEXTURE_FORMAT
is not EGL_NO_TEXTURE , then the pbuffer width and
height specify the size of the level zero texture image
If EGL_LARGEST_PBUFFER is specified and if the
pbuffer will be used as a texture (i.e. the value of
EGL_TEXTURE_TARGET is EGL_TEXTURE_2D ,
and the value of EGL_TEXTURE FORMAT is
EGL_TEXTURE_RGB or EGL_TEXTURE_RGBA ),
then the aspect ratio will be preserved and the new width and
height will be valid sizes for the texture target (e.g. if the
underlying OpenGL ES implementation does not support
non-power-of-two textures, both the width and height will be a
power of 2).
The contents of the depth and stencil buffers may not be
preserved when rendering a texture to the pbuffer and switching
which image of the texture is rendered to (e.g., switching from
rendering one mipmap level to rendering another).
Errors
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 ).
(1.1 only) EGL_BAD_VALUE is generated if the
EGL_TEXTURE_FORMAT attribute is not
EGL_NO_TEXTURE , and EGL_WIDTH and/or
EGL_HEIGHT specify an invalid size (e.g., the
texture size is not a power of 2, and the underlying OpenGL ES
implementation does not support non-power-of-two textures).
(1.1 only) EGL_BAD_VALUE can also be generated if
The EGL_TEXTURE_FORMAT attribute is
EGL_NO_TEXTURE , and EGL_TEXTURE_TARGET
is something other than EGL_NO_TEXTURE ; or,
EGL_TEXTURE_FORMAT is something other than
EGL_NO_TEXTURE , and EGL_TEXTURE_TARGET
is EGL_NO_TEXTURE .
Parameters: display - Specifies the EGL display connection. Parameters: config - Specifies the EGL frame buffer configuration thatdefines the frame buffer resource available to the surface. Parameters: attrib_list - Specifies the pixel buffer surfaceattributes. May be null or empty (first attribute isEGL_NONE ). An EGLSurface for offscreen rendering. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if config isnull . exception: IllegalArgumentException - if attrib_list is non-null but is not terminated withEGL_NONE . |
eglCreatePixmapSurface | EGLSurface eglCreatePixmapSurface(EGLDisplay display, EGLConfig config, Object native_pixmap, int[] attrib_list)(Code) | | Create a new EGL pixmap surface.
eglCreatePixmapSurface creates an off-screen EGL
pixmap surface and returns its handle. If
eglCreatePixmapSurface fails to create a pixmap
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 ID of
config .
Use eglDestroySurface to destroy the surface.
Notes
On JME CLDC/MIDP platforms, native_pixmap must be
an instance of javax.microedition.lcdui.Graphics
that was created directly from a mutable instance of
javax.microedition.lcdui.Image .
Errors
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 config.
EGL_BAD_NATIVE_PIXMAP may be generated if
native_pixmap is not a valid native pixmap.
EGL_BAD_ATTRIBUTE is generated if
attrib_list contains an invalid pixmap 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 the attributes of
native_pixmap do not correspond to
config or if config does not support
rendering to pixmaps (the EGL_SURFACE_TYPE attribute
does not contain EGL_PIXMAP_BIT ).
Parameters: display - Specifies the EGL display connection. Parameters: config - Specifies the EGL frame buffer configuration thatdefines the frame buffer resource available to the surface. Parameters: native_pixmap - Specifies the native pixmap. Parameters: attrib_list - Specifies pixmap surface attributes. Must benull or empty (first attribute is EGL_NONE ). An EGLSurface for offscreen rendering. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if config isnull exception: IllegalArgumentException - if native_pixmap is null or is not of a suitable type for theunderlying platform (e.g., not a mutable Image forCLDC/MIDP). exception: IllegalArgumentException - if attrib_list is non-null but is not terminated withEGL_NONE .
|
eglCreateWindowSurface | EGLSurface eglCreateWindowSurface(EGLDisplay display, EGLConfig config, Object native_window, int[] attrib_list)(Code) | | Create a new EGL window surface.
eglCreateWindowSurface creates an EGL window surface
and returns its handle. If eglCreateWindowSurface
fails to create a window 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 ID of
config .
Use eglDestroySurface to destroy the surface.
Notes
On JME CLDC/MIDP platforms, native_window must be
an instance of javax.microedition.lcdui.Graphics
object created directly from an instance of
GameCanvas or from the argument supplied to the
Canvas.paint method.
Errors
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_NATIVE_WINDOW may be generated if
native_window is not a valid native window.
EGL_BAD_ATTRIBUTE is generated if
attrib_list contains an invalid window attribute or
if an attribute value is not recognized or is 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 the attributes of
native_window do not correspond to
config or if config does not support
rendering to windows (the EGL_SURFACE_TYPE attribute
does not contain EGL_WINDOW_BIT ).
Parameters: display - Specifies the EGL display connection. Parameters: config - Specifies the EGL frame buffer configuration thatdefines the frame buffer resource available to the surface. Parameters: native_window - Specifies the native window. Parameters: attrib_list - Specifies window surface attributes. Must benull or empty (first attribute is EGL_NONE ). an EGLSurface for rendering to the window. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if config isnull . exception: IllegalArgumentException - if native_window is null or is not of a suitable type for theunderlying platform (e.g., not a properly-createdjavax.microedition.lcdui.Graphics instance forCLDC/MIDP). exception: IllegalArgumentException - if attrib_list is non-null but is not terminated withEGL_NONE .
|
eglDestroyContext | boolean eglDestroyContext(EGLDisplay display, EGLContext context)(Code) | | Destroy an EGL rendering context.
If the EGL rendering context context is not current to any
thread, eglDestroyContext destroys it
immediately. Otherwise, context is destroyed when it
becomes not current to any thread.
Errors
false is returned if destruction of the context
fails, 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_CONTEXT is generated if context
is not an EGL rendering context.
Parameters: display - Specifies the EGL display connection. Parameters: context - Specifies the EGL rendering context to be destroyed. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if context isnull . true if the operation succeeds.
|
eglDestroySurface | boolean eglDestroySurface(EGLDisplay display, EGLSurface surface)(Code) | | Destroy an EGL surface.
If the EGL surface surface is not current to any
thread, eglDestroySurface destroys it
immediately. Otherwise, surface is destroyed when it
becomes not current to any thread.
(1.1) In OpenGL ES 1.1, resources associated with a pbuffer surface
are not released until all color buffers of that pbuffer bound to
a texture object have been released.
Errors
false is returned if destruction of the surface
fails, 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.
Parameters: display - Specifies the EGL display connection. Parameters: surface - Specifies the EGL surface to be destroyed. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if surface isnull . true if the operation succeeds.
|
eglGetConfigAttrib | boolean eglGetConfigAttrib(EGLDisplay display, EGLConfig config, int attribute, int[] value)(Code) | | Return information about an EGL frame buffer configuration.
eglGetConfigAttrib returns in value[0] the
value of attribute for
config . attribute can be one of the
following:
EGL_BUFFER_SIZE
Returns the depth of the color buffer. It is the sum of
EGL_RED_SIZE , EGL_GREEN_SIZE ,
EGL_BLUE_SIZE , and EGL_ALPHA_SIZE .
EGL_RED_SIZE
Returns the number of bits of red stored in the color buffer.
EGL_GREEN_SIZE
Returns the number of bits of green stored in the color buffer.
EGL_BLUE_SIZE
Returns the number of bits of blue stored in the color buffer.
EGL_ALPHA_SIZE
Returns the number of bits of alpha stored in the color buffer.
EGL_CONFIG_CAVEAT
Returns the caveats for the frame buffer configuration. Possible
caveat values are EGL_NONE ,
EGL_SLOW_CONFIG , and
EGL_NON_CONFORMANT .
EGL_CONFIG_ID
Returns the ID of the frame buffer configuration.
EGL_DEPTH_SIZE
Returns the number of bits in the depth buffer.
EGL_LEVEL
Returns the frame buffer level. Level zero is the default frame
buffer. Positive levels correspond to frame buffers that overlay
the default buffer and negative levels correspond to frame
buffers that underlay the default buffer.
EGL_MAX_PBUFFER_WIDTH
Returns the maximum width of a pixel buffer surface in pixels.
EGL_MAX_PBUFFER_HEIGHT
Returns the maximum height of a pixel buffer surface in pixels.
EGL_MAX_PBUFFER_PIXELS
Returns the maximum size of a pixel buffer surface in pixels.
EGL_NATIVE_RENDERABLE
Returns EGL_TRUE if native rendering APIs can render
into the surface, EGL_FALSE otherwise.
EGL_NATIVE_VISUAL_ID
Returns the ID of the associated native visual.
EGL_NATIVE_VISUAL_TYPE
Returns the type of the associated native visual.
EGL_PRESERVED_RESOURCES (1.0 only)
Returns EGL_TRUE if resources are preserved across
power management events, EGL_FALSE otherwise.
EGL_SAMPLE_BUFFERS
Returns the number of multisample buffers.
EGL_SAMPLES
Returns the number of samples per pixel.
EGL_STENCIL_SIZE
Returns the number of bits in the stencil buffer.
EGL_SURFACE_TYPE
Returns the types of supported EGL surfaces.
EGL_TRANSPARENT_TYPE
Returns the type of supported transparency. Possible transparency
values are: EGL_NONE , and
EGL_TRANSPARENT_RGB .
EGL_TRANSPARENT_RED_VALUE
Returns the transparent red value.
EGL_TRANSPARENT_GREEN_VALUE
Returns the transparent green value.
EGL_TRANSPARENT_BLUE_VALUE
Returns the transparent blue value.
EGL_BIND_TO_TEXTURE_RGB (1.1 only)
Returns EGL_TRUE if color buffers can be bound to an
RGB texture, EGL_FALSE otherwise.
EGL_BIND_TO_TEXTURE_RGBA (1.1 only)
Returns EGL_TRUE if color buffers can be bound to an
RGBA texture, EGL_FALSE otherwise.
EGL_MAX_SWAP_INTERVAL (1.1 only)
Returns the maximum value that can be passed to
eglSwapInterval .
EGL_MIN_SWAP_INTERVAL (1.1 only)
Returns the minimum value that can be passed to
eglSwapInterval .
Errors
false is returned on failure, true
otherwise. value is not modified when
false is returned.
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
attribute is not a valid frame buffer configuration
attribute.
Parameters: display - Specifies the EGL display connection. Parameters: config - Specifies the EGL frame buffer configuration to be queried. Parameters: attribute - Specifies the EGL rendering context attribute tobe returned. Parameters: value - An int array of length at least 1 inwhich the requested value will be returned as element 0. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if config isnull . exception: IllegalArgumentException - if value isnull or has length less than 1. true if the query succeeds.
|
eglGetConfigs | boolean eglGetConfigs(EGLDisplay display, EGLConfig[] configs, int config_size, int[] num_config)(Code) | | Return a list of all EGL frame buffer configurations for a display.
eglGetConfigs returns a list of all EGL frame
buffer configurations that are available for the specified
display. The items in the list can be used in any EGL function
that requires an EGL frame buffer configuration. No more than
config_size EGLConfig s will be returned
even if more are available on the specified display.
configs does not return values, if it is specified
as null . This is useful for querying just the number
of all frame buffer configurations.
Use eglGetConfigAttrib to retrieve individual
attribute values of a frame buffer configuration.
Errors
false is returned on failure, true
otherwise. configs and num_config are
not modified when false is returned.
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_PARAMETER is generated if
num_config is null .
Parameters: display - Specifies the EGL display connection. Parameters: configs - An array of EGLConfig objects intowhich a list of configs will be stored, or null . Parameters: config_size - Specifies the size of the list of configs. Parameters: num_config - An int array, in which the numberof configs will be returned in element 0. true if the operation succeeds. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if configs isnon-null and configs.length is smallerthan config_size . exception: IllegalArgumentException - if num_config isnon-null but has length less than 1.
|
eglGetCurrentContext | EGLContext eglGetCurrentContext()(Code) | | Return the current EGL rendering context.
eglGetCurrentContext returns the current EGL
rendering context, as specified by
eglMakeCurrent . If no context is current,
EGL_NO_CONTEXT is returned.
The current EGLContext , orEGL_NO_CONTEXT .
|
eglGetCurrentDisplay | EGLDisplay eglGetCurrentDisplay()(Code) | | Return the display for the current EGL rendering context.
eglGetCurrentDisplay returns the current EGL display
connection for the current EGL rendering context, as specified by
eglMakeCurrent . If no context is current,
EGL_NO_DISPLAY is returned.
The current EGLDisplay
|
eglGetCurrentSurface | EGLSurface eglGetCurrentSurface(int readdraw)(Code) | | Return the read or draw surface for the current EGL rendering
context.
eglGetCurrentSurface returns the read or draw
surface attached to the current EGL rendering context, as
specified by eglMakeCurrent . If no context is
current, EGL_NO_SURFACE is returned.
Parameters: readdraw - Specifies whether the EGL read or draw surface isto be returned, one of EGL_READ orEGL_DRAW . The current EGLSurface used for reading (ifreaddraw equals EGL_READ , or drawing(if readdraw equals EGL_DRAW ). exception: IllegalArgumentException - if readdraw isnot one of the specified constants.
|
eglGetDisplay | EGLDisplay eglGetDisplay(Object native_display)(Code) | | Return an EGL display connection.
eglGetDisplay obtains the EGL display connection
for the native display native_display .
If display_id is
EGL_DEFAULT_DISPLAY , a default display connection is
returned.
If no display connection matching native_display
is available, EGL_NO_DISPLAY is returned. No error
is generated.
Use eglInitialize to initialize the display
connection.
Parameters: native_display - Specifies the display to connectto. EGL_DEFAULT_DISPLAY indicates the defaultdisplay. An EGLDisplay object. exception: IllegalArgumentException - if native_display isnull or is not of a suitable type for the platform. |
eglGetError | int eglGetError()(Code) | | Return error information.
eglGetError returns the error of the last called EGL
function in the current thread. Initially, the error is set to
EGL_SUCCESS .
The following errors are currently defined:
EGL_SUCCESS
The last function succeeded without error.
EGL_NOT_INITIALIZED
EGL is not initialized, or could not be initialized, for the
specified EGL display connection.
EGL_BAD_ACCESS
EGL cannot access a requested resource (for example a context
is bound in another thread).
EGL_BAD_ALLOC
EGL failed to allocate resources for the requested operation.
EGL_BAD_ATTRIBUTE
An unrecognized attribute or attribute value was passed in
the attribute list.
EGL_BAD_CONTEXT
An EGLContext argument does not name a valid EGL
rendering context.
EGL_BAD_CONFIG
An EGLConfig argument does not name a valid EGL
frame buffer configuration.
EGL_BAD_CURRENT_SURFACE
The current surface of the calling thread is a window, pixel
buffer or pixmap that is no longer valid.
EGL_BAD_DISPLAY
An EGLDisplay argument does not name a valid EGL
display connection.
EGL_BAD_SURFACE
An EGLSurface argument does not name a valid
surface (window, pixel buffer or pixmap) configured for GL
rendering.
EGL_BAD_MATCH
Arguments are inconsistent (for example, a valid context
requires buffers not supplied by a valid surface).
EGL_BAD_PARAMETER
One or more argument values are invalid.
EGL_BAD_NATIVE_PIXMAP
A native_pixmap argument does not refer to a
valid native pixmap.
EGL_BAD_NATIVE_WINDOW
A native_window argument does not refer to a
valid native window.
EGL_CONTEXT_LOST (1.1 only)
A power management event has occurred. The application must
destroy all contexts and reinitialise OpenGL ES state and objects
to continue rendering.
Errors
A call to eglGetError sets the error to
EGL_SUCCESS .
One of EGL_SUCCESS ,EGL_NOT_INITIALIZED , EGL_BAD_ACCESS ,EGL_BAD_ALLOC , EGL_BAD_ATTRIBUTE ,EGL_BAD_CONTEXT , EGL_BAD_CONFIG ,EGL_BAD_CURRENT_SURFACE ,EGL_BAD_DISPLAY , EGL_BAD_MATCH ,EGL_BAD_NATIVE_PIXMAP ,EGL_BAD_NATIVE_WINDOW ,EGL_BAD_PARAMETER , EGL_BAD_SURFACE , orother error code defined by an extension. |
eglInitialize | boolean eglInitialize(EGLDisplay display, int[] major_minor)(Code) | | Initialize an EGL display connection.
eglInitialize initializes the EGL display
connection obtained with eglGetDisplay . Initializing
an already initialized EGL display connection has no effect
besides returning the version numbers and returing
true .
No value is returned in major_minor if it is specified as
null .
Use eglTerminate to release resources associated
with an EGL display connection.
Errors
false is returned if eglInitialize
fails, true otherwise. major_minor is
not modified when false is returned.
EGL_BAD_DISPLAY is generated if
display is not an EGL display connection.
EGL_NOT_INITIALIZED is generated if
display cannot be initialized.
Parameters: display - Specifies the EGL display connection to initialize. Parameters: major_minor - an int array of length at least2, in which the major and minor version number of the EGLimplementation will be returned as elements 0 and 1. May benull . true if the operation succeeds. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if major_minor isnon-null but has length less than 2.
|
eglMakeCurrent | boolean eglMakeCurrent(EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context)(Code) | | Attach an EGL rendering context to EGL surfaces.
eglMakeCurrent binds context to the
current rendering thread and to the draw and
read surfaces. draw is used for all GL
operations except for any pixel data read back
(glReadPixels , glCopyTexImage2D , and
glCopyTexSubImage2D ), which is taken from the frame
buffer values of read .
If the calling thread has already a current rendering context,
that context is flushed and marked as no longer current.
The first time that context is made current, the viewport and
scissor dimensions are set to the size of the draw
surface. The viewport and scissor are not modified when
context is subsequently made current.
To release the current context without assigning a new one, call
eglMakeCurrent with draw and read set
to EGL_NO_SURFACE and context set to
EGL_NO_CONTEXT .
Use eglGetCurrentContext ,
eglGetCurrentDisplay , and
eglGetCurrentSurface to query the current rendering
context and associated display connection and surfaces.
Errors
false is returned on failure,
true otherwise. If false is
returned, the previously current rendering context and surfaces
(if any) remain unchanged.
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 draw or
read is not an EGL surface.
EGL_BAD_CONTEXT is generated if context
is not an EGL rendering context.
EGL_BAD_MATCH is generated if draw or
read are not compatible with context, or if
context is set to EGL_NO_CONTEXT and
draw or read are not set to
EGL_NO_SURFACE , or if draw or
read are set to EGL_NO_SURFACE and
context is not set to EGL_NO_CONTEXT .
EGL_BAD_ACCESS is generated if context
is current to some other thread.
EGL_BAD_NATIVE_PIXMAP may be generated if a native
pixmap underlying either draw or read
is no longer valid.
EGL_BAD_NATIVE_WINDOW may be generated if a native
window underlying either draw or read
is no longer valid.
EGL_BAD_CURRENT_SURFACE is generated if the previous
context has unflushed commands and the previous surface is no
longer valid.
EGL_BAD_ALLOC may be generated if allocation of
ancillary buffers for draw or read were delayed until
eglMakeCurrent is called, and there are not enough
resources to allocate them.
EGL_CONTEXT_LOST (1.1 only)
A power management event has occurred. The application must
destroy all contexts and reinitialise OpenGL ES state and objects
to continue rendering.
Parameters: display - Specifies the EGL display connection. Parameters: draw - Specifies the EGL draw surface. Parameters: read - Specifies the EGL read surface. Parameters: context - Specifies the EGL rendering context to be attachedto the surfaces. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if draw isnull . exception: IllegalArgumentException - if read isnull . exception: IllegalArgumentException - if context isnull . true if the operation succeeds. |
eglQueryContext | boolean eglQueryContext(EGLDisplay display, EGLContext context, int attribute, int[] value)(Code) | | Return EGL rendering context information.
eglQueryContext returns in value[0] the
value of attribute for
context . attribute can be one of the
following:
Errors
false is returned on failure, true
otherwise. value is not modified when
false is returned.
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_CONTEXT is generated if context
is not an EGL rendering context.
EGL_BAD_ATTRIBUTE is generated if
attribute is not a valid context attribute.
Parameters: display - Specifies the EGL display connection. Parameters: context - Specifies the EGL rendering context to query. Parameters: attribute - Specifies the EGL rendering context attribute tobe returned. Parameters: value - Returns the requested value. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if context isnull . exception: IllegalArgumentException - if value isnull or has length less than 1. true if the query succeeds.
|
eglQueryString | String eglQueryString(EGLDisplay display, int name)(Code) | | Return a string describing an EGL display connection.
eglQueryString returns a String
describing an EGL display connection. name can be
one of the following:
EGL_VENDOR
Returns the company responsible for this EGL implementation. This
name does not change from release to release.
EGL_VERSION
Returns a version or release number. The EGL_VERSION
string is laid out as follows:
major_version.minor_version space vendor_specific_info
EGL_EXTENSIONS
Returns a space-separated list of supported extensions to EGL.
The string data returned from the native EGL implementation is
converted into UTF8 format and returned as a Java
String .
Errors
null is returned on failure.
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_PARAMETER is generated if
name is not an accepted value.
Parameters: display - Specifies the EGL display connection. Parameters: name - Specifies a symbolic constant, one ofEGL_VENDOR , EGL_VERSION , orEGL_EXTENSIONS . exception: IllegalArgumentException - if display isnull . A String containing the query result.
|
eglQuerySurface | boolean eglQuerySurface(EGLDisplay display, EGLSurface surface, int attribute, int[] value)(Code) | | Return EGL surface information.
eglQuerySurface returns in value[0] the
value of attribute for
surface . attribute can be one of the
following:
EGL_CONFIG_ID
Returns the ID of the EGL frame buffer configuration with respect
to which the surface was created.
EGL_WIDTH
Returns the width of the surface in pixels.
EGL_HEIGHT
Returns the height of the surface in pixels.
EGL_LARGEST_PBUFFER
Returns the same attribute value specified when the surface was
created with eglCreatePbufferSurface . For a window
or pixmap surface, value is not modified.
EGL_TEXTURE_FORMAT (1.1 only)
Returns format of texture. Possible values are
EGL_NO_TEXTURE , EGL_TEXTURE_RGB , and
EGL_TEXTURE_RGBA .
EGL_TEXTURE_TARGET (1.1 only)
Returns type of texture. Possible values are
EGL_NO_TEXTURE , or EGL_TEXTURE_2D .
EGL_MIPMAP_TEXTURE (1.1 only)
Returns EGL_TRUE if texture has mipmaps,
EGL_FALSE otherwise.
EGL_MIPMAP_LEVEL (1.1 only)
Returns which level of the mipmap to render to, if texture has mipmaps.
1.1 Notes
Querying EGL_TEXTURE_FORMAT ,
EGL_TEXTURE_TARGET , EGL_MIPMAP_TEXTURE ,
or EGL_MIPMAP_LEVEL for a non-pbuffer surface is not
an error, but value is not modified.
Errors
false is returned on failure, true
otherwise. value is not modified when
false is returned.
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. Parameters: surface - Specifies the EGL surface to query. Parameters: attribute - Specifies the EGL surface attribute to be returned. Parameters: value - Returns the requested value. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if surface isnull . exception: IllegalArgumentException - if value isnull or has length less than 1. true if the query succeeds.
|
eglSwapBuffers | boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface)(Code) | | Post EGL surface color buffer to a native window.
If surface is a window surface, eglSwapBuffers posts
its color buffer to the associated native window.
eglSwapBuffers performs an implicit
glFlush before it returns. Subsequent GL commands
may be issued immediately after calling
eglSwapBuffers , but are not executed until the
buffer exchange is completed.
If surface is a pixel buffer or a pixmap,
eglSwapBuffers has no effect, and no error is
generated.
Notes
The color buffer of surface is left undefined after calling
eglSwapBuffers .
On the CLDC/MIDP plaform, calling eglSwapBuffers
is equivalent to calling glFinish when drawing to a
GameCanvas . The
GameCanvas.flushGraphics method is used to copy the
contents of the back buffer to the screen.
Errors
false is returned if swapping of the surface
buffers fails, 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 drawing surface.
EGL_CONTEXT_LOST (1.1 only)
A power management event has occurred. The application must
destroy all contexts and reinitialise OpenGL ES state and objects
to continue rendering.
Parameters: display - Specifies the EGL display connection. Parameters: surface - Specifies the EGL drawing surface whose buffersare to be swapped. exception: IllegalArgumentException - if display isnull . exception: IllegalArgumentException - if surface isnull . true if the operation succeeds. |
eglTerminate | boolean eglTerminate(EGLDisplay display)(Code) | | Terminate an EGL display connection.
eglTerminate releases resources associated with
an EGL display connection. Termination marks all EGL resources
associated with the EGL display connection for deletion. If
contexts or surfaces associated with display is
current to any thread, they are not released until they are no
longer current as a result of eglMakeCurrent .
Terminating an already terminated EGL display connection has
no effect other than returning true . A terminated
display may be re-initialized by calling
eglInitialize again.
Errors
false is returned if eglTerminate
fails, true otherwise.
EGL_BAD_DISPLAY is generated if display is not an
EGL display connection.
Parameters: display - Specifies the EGL display connection to terminate. exception: IllegalArgumentException - if display isnull . true if the operation succeeds.
|
eglWaitGL | boolean eglWaitGL()(Code) | | Complete GL execution prior to subsequent native rendering calls.
GL rendering calls made prior to eglWaitGL are
guaranteed to be executed before native rendering calls made
after eglWaitGL . The same result can be achieved
using glFinish .
eglWaitGL is ignored if there is no current EGL
rendering context.
Errors
false is returned if eglWaitGL fails,
true otherwise.
EGL_BAD_NATIVE_SURFACE is generated if the surface
associated with the current context has a native window or
pixmap, and that window or pixmap is no longer valid.
true if the operation succeeds.
|
eglWaitNative | boolean eglWaitNative(int engine, Object bindTarget)(Code) | | Complete native execution prior to subsequent GL rendering calls.
Native rendering calls made prior to eglWaitNative
are guaranteed to be executed before GL rendering calls made
after eglWaitNative .
eglWaitNative is ignored if there is no current EGL
rendering context.
Notes
In a MIDP environment, OpenGL ES drawing to an Image ,
Canvas , or GameCanvas must be preceded
by a call to
eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE ,
graphics) and followed by a call to
eglWaitGL() . The bindTarget parameter
must be the instance of
javax.microedition.lcdui.Graphics obtained from the
GameCanvas.getGraphics method (if drawing to a
GameCanvas ), from the Image.getGraphics()
method (if drawing to a mutable Image ),
or the instance obtained as the
parameter to the Canvas.paint method (if drawing to
a Canvas ).
The results of passing improper values for engine
and/or bindTarget are undefined.
The results of MIDP drawing calls are undefined from the time
of the call to eglWaitNative until
eglWaitGL returns.
Errors
EGL_BAD_PARAMETER is generated if
engine is not a recognized marking engine.
EGL_BAD_NATIVE_SURFACE is generated if the surface
associated with the current context has a native window or
pixmap, and that window or pixmap is no longer valid.
Parameters: engine - Specifies a particular marking engine to be waitedon. Must be EGL_CORE_NATIVE_ENGINE . Parameters: bindTarget - the rendering target shared by the nativeengine and the EGL drawing surface. For MIDP, must be theinstance of javax.microedition.lcdui.Graphics representing the targetted Canvas , Image , orGameCanvas . true if the operation succeeds.
|
|
|