Class EGL
- java.lang.Object
-
- org.lwjgl.egl.EGL
-
public final class EGL extends java.lang.ObjectThis 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
EGLCapabilitiesclasses. AnEGLCapabilitiesinstance 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_INIToption 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_NAMEoption.EGLCapabilities creation
Instances of
EGLCapabilitiesfor an EGLDisplay can be created with thecreateDisplayCapabilities(long)method. Calling this method is expensive, so theEGLCapabilitiesinstance should be associated with the EGLDisplay and reused as necessary.The
EGLCapabilitiesinstance 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 voidcreate()Loads the EGL native library, using the default library name.static voidcreate(java.lang.String libName)Loads the EGL native library, using the specified library name.static voidcreate(org.lwjgl.system.FunctionProvider functionProvider)Initializes EGL with the specifiedFunctionProvider.static EGLCapabilitiescreateDisplayCapabilities(long dpy)Creates anEGLCapabilitiesinstance for the specified EGLDisplay handle.static EGLCapabilitiescreateDisplayCapabilities(long dpy, int majorVersion, int minorVersion)Creates anEGLCapabilitiesinstance for the specified EGLDisplay handle.static voiddestroy()Unloads the EGL native library.static EGLCapabilitiesgetCapabilities()Returns theEGLCapabilitiesinstance for the EGL client library.static org.lwjgl.system.FunctionProvidergetFunctionProvider()Returns theFunctionProviderfor 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 theFunctionProviderfor the EGL native library.
-
getCapabilities
@Nullable public static EGLCapabilities getCapabilities()
Returns theEGLCapabilitiesinstance 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_extensionsextension are supported. If not, all flags will be false and the version fields zero.
-
createDisplayCapabilities
public static EGLCapabilities createDisplayCapabilities(long dpy)
Creates anEGLCapabilitiesinstance 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 anEGLCapabilitiesinstance 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
-
-