Class EGL
- java.lang.Object
-
- org.lwjgl.egl.EGL
-
public final class EGL extends java.lang.Object
This class must be used before any EGL function is called. It has the following responsibilities:
- Loads the EGL native library into the JVM process.
- Creates instances of
EGLCapabilities
classes. AnEGLCapabilities
instance contains flags for functionality that is available in an EGLDisplay or the EGL client library. Internally, it also contains function pointers that are only valid in that specific EGLDisplay or client library.
Library lifecycle
The EGL library is loaded automatically when this class is initialized. Set the
Configuration.EGL_EXPLICIT_INIT
option to override this behavior. Manual loading/unloading can be achieved with thecreate()
anddestroy()
functions. The name of the library loaded can be overridden with theConfiguration.EGL_LIBRARY_NAME
option.EGLCapabilities creation
Instances of
EGLCapabilities
for an EGLDisplay can be created with thecreateDisplayCapabilities(long)
method. Calling this method is expensive, so theEGLCapabilities
instance should be associated with the EGLDisplay and reused as necessary.The
EGLCapabilities
instance for the client library is created automatically when the EGL native library is loaded.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
create()
Loads the EGL native library, using the default library name.static void
create(java.lang.String libName)
Loads the EGL native library, using the specified library name.static void
create(org.lwjgl.system.FunctionProvider functionProvider)
Initializes EGL with the specifiedFunctionProvider
.static EGLCapabilities
createDisplayCapabilities(long dpy)
Creates anEGLCapabilities
instance for the specified EGLDisplay handle.static EGLCapabilities
createDisplayCapabilities(long dpy, int majorVersion, int minorVersion)
Creates anEGLCapabilities
instance for the specified EGLDisplay handle.static void
destroy()
Unloads the EGL native library.static EGLCapabilities
getCapabilities()
Returns theEGLCapabilities
instance for the EGL client library.static org.lwjgl.system.FunctionProvider
getFunctionProvider()
Returns theFunctionProvider
for the EGL native library.
-
-
-
Method Detail
-
create
public static void create()
Loads the EGL native library, using the default library name.
-
create
public static void create(java.lang.String libName)
Loads the EGL native library, using the specified library name.- Parameters:
libName
- the native library name
-
create
public static void create(org.lwjgl.system.FunctionProvider functionProvider)
Initializes EGL with the specifiedFunctionProvider
. This method can be used to implement custom EGL library loading.- Parameters:
functionProvider
- the provider of EGL function addresses
-
destroy
public static void destroy()
Unloads the EGL native library.
-
getFunctionProvider
@Nullable public static org.lwjgl.system.FunctionProvider getFunctionProvider()
Returns theFunctionProvider
for the EGL native library.
-
getCapabilities
@Nullable public static EGLCapabilities getCapabilities()
Returns theEGLCapabilities
instance for the EGL client library. The capability flags in this instance are only set for the core EGL versions and client extensions. This may only happen if EGL 1.5 or theEGLCapabilities.EGL_EXT_client_extensions
extension are supported. If not, all flags will be false and the version fields zero.
-
createDisplayCapabilities
public static EGLCapabilities createDisplayCapabilities(long dpy)
Creates anEGLCapabilities
instance for the specified EGLDisplay handle.This method call is relatively expensive. The result should be cached and reused.
- Parameters:
dpy
- the EGLDisplay to query- Returns:
- the
instance
-
createDisplayCapabilities
public static EGLCapabilities createDisplayCapabilities(long dpy, int majorVersion, int minorVersion)
Creates anEGLCapabilities
instance for the specified EGLDisplay handle.This method call is relatively expensive. The result should be cached and reused.
- Parameters:
dpy
- the EGLDisplay to querymajorVersion
- the major EGL version supported by the EGLDisplay, as returned byEGL10.eglInitialize(long, java.nio.IntBuffer, java.nio.IntBuffer)
minorVersion
- the minor EGL version supported by the EGLDisplay, as returned byEGL10.eglInitialize(long, java.nio.IntBuffer, java.nio.IntBuffer)
- Returns:
- the
instance
-
-