Package org.lwjgl.system
Class Library
- java.lang.Object
-
- org.lwjgl.system.Library
-
public final class Library extends java.lang.Object
Initializes the LWJGL shared library and handles loading additional shared libraries.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
JNI_LIBRARY_NAME
The LWJGL shared library name.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
initialize()
Ensures that the LWJGL shared library has been loaded.static SharedLibrary
loadNative(Configuration<java.lang.String> name, java.lang.String... defaultNames)
Loads a shared library usingLibrary.loadNative(String)
with the name specified byname
.static SharedLibrary
loadNative(java.lang.String name)
Loads a shared library using OS-specific APIs (e.g.static void
loadSystem(java.lang.String name)
Loads a shared library usingSystem.load(java.lang.String)
.
-
-
-
Method Detail
-
initialize
public static void initialize()
Ensures that the LWJGL shared library has been loaded.
-
loadSystem
public static void loadSystem(java.lang.String name) throws java.lang.UnsatisfiedLinkError
Loads a shared library usingSystem.load(java.lang.String)
.- Parameters:
name
- the library name. If not an absolute path, it must be the plain library name, without an OS specific prefix or file extension (e.g. GL, not libGL.so)- Throws:
java.lang.UnsatisfiedLinkError
- if the library could not be loaded
-
loadNative
public static SharedLibrary loadNative(java.lang.String name)
Loads a shared library using OS-specific APIs (e.g.LoadLibrary
ordlopen
).- Parameters:
name
- the library name. OS-specific prefixes and file extensions are optional (e.g. both"GL"
and"libGL.so.1"
are valid on Linux)- Returns:
- the shared library
- Throws:
java.lang.UnsatisfiedLinkError
- if the library could not be loaded
-
loadNative
public static SharedLibrary loadNative(Configuration<java.lang.String> name, java.lang.String... defaultNames)
Loads a shared library usingLibrary.loadNative(String)
with the name specified byname
. Ifname
is not set,Library.loadNative(String)
will be called with the names specified bydefaultNames
. The first successful will be returned.- Parameters:
name
- aConfiguration
that specifies the library namedefaultNames
- the default library name- Returns:
- the shared library
- Throws:
java.lang.UnsatisfiedLinkError
- if the library could not be loaded
-
-