Package org.lwjgl.egl

Class 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. An EGLCapabilities 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 the create() and destroy() functions. The name of the library loaded can be overridden with the Configuration.EGL_LIBRARY_NAME option.

    EGLCapabilities creation

    Instances of EGLCapabilities for an EGLDisplay can be created with the createDisplayCapabilities(long) method. Calling this method is expensive, so the EGLCapabilities 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 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​(FunctionProvider functionProvider)
        Initializes EGL with the specified FunctionProvider. 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.
      • getCapabilities

        @Nullable
        public static EGLCapabilities getCapabilities()
        Returns the EGLCapabilities 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 the EGLCapabilities.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 an EGLCapabilities 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