Top Description Inners Fields Constructors Methods
org.lwjgl.system

public Class Configuration<T>

extends Object
Class Inheritance
Imports
org.lwjgl.system.MemoryUtil.*, javax.annotation.*, java.io.*, java.util.function.*

This class can be used to programmatically set the LWJGL runtime configuration. It is an alternative to using system properties.

Care must be taken when setting static options. Such options are only read once or cached in static final fields. They must be configured through this class before touching any other LWJGL class.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
public static final Configuration<Integer>
ARRAY_TLC_SIZE

Sets the size of arrays cached in thread-local storage to minimize allocations while decoding text.

public static final Configuration<String>
ASSIMP_DRACO_LIBRARY_NAME

Similar to LIBRARY_NAME for the Draco library (org.lwjgl.assimp.draco.libname).

public static final Configuration<String>
ASSIMP_LIBRARY_NAME

Similar to LIBRARY_NAME for the AssImp library (org.lwjgl.assimp.libname).

public static final Configuration<String>
BGFX_LIBRARY_NAME

Similar to LIBRARY_NAME for the BGFX library (org.lwjgl.bgfx.libname).

public static final Configuration<Object>
BUNDLED_LIBRARY_NAME_MAPPER

Sets the mapping algorithm used to resolve the name of bundled shared libraries.

public static final Configuration<Object>
BUNDLED_LIBRARY_PATH_MAPPER

Sets the mapping algorithm used to resolve bundled shared libraries in the classpath/modulepath.

public static final Configuration<Boolean>
CUDA_API_PER_THREAD_DEFAULT_STREAM

To enable per-thread synchronization, set this option to true before initializing the CUDA driver.

public static final Configuration<String>
CUDA_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA Driver library – nvcuda (org.lwjgl.cuda.libname).

public static final Configuration<String>
CUDA_NVRTC_BUILTINS_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA NVRTC Builtins library (org.lwjgl.cuda.nvrtc-builtins.libname).

public static final Configuration<String>
CUDA_NVRTC_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA NVRTC library (org.lwjgl.cuda.nvrtc.libname).

public static final Configuration<String>
CUDA_TOOLKIT_PATH

This option can be used to load toolkit libraries from a non-standard installation folder.

public static final Configuration<String>
CUDA_TOOLKIT_VERSION

This option can be used to force a specific CUDA Toolkit version.

public static final Configuration<Boolean>
DEBUG

Set to true to enable LWJGL's debug mode.

public static final Configuration<Boolean>
DEBUG_FUNCTIONS

When enabled, a warning message will be output to DEBUG_STREAM when LWJGL fails to retrieve a function pointer.

public static final Configuration<Boolean>
DEBUG_LOADER

When enabled, SharedLibraryLoader exceptions will be printed to the DEBUG_STREAM.

public static final Configuration<Boolean>
DEBUG_MEMORY_ALLOCATOR

Set to true to enable LWJGL's debug mode for the MemoryUtil explicit memory management API (memAlloc/memFree/etc).

public static final Configuration<Boolean>
DEBUG_MEMORY_ALLOCATOR_FAST

Set to true to skip stacktrace generation on each tracked allocation.

public static final Configuration<Boolean>
DEBUG_MEMORY_ALLOCATOR_INTERNAL

Set to false to disable tracking of internal memory allocations, in native shared libraries that have been set up to use the LWJGL memory allocator.

public static final Configuration<Boolean>
DEBUG_STACK

Set to true to enable LWJGL's debug mode for the MemoryStack.

public static final Configuration<Object>
DEBUG_STREAM

Can be set to override the default APIUtil#DEBUG_STREAM.

public static final Configuration<Boolean>
DISABLE_CHECKS

Set to true to disable LWJGL's basic checks.

public static final Configuration<Boolean>
DISABLE_FUNCTION_CHECKS

Set to true to disable LWJGL's function lookup checks.

public static final Configuration<Boolean>
EGL_EXPLICIT_INIT

Set this property to false to disable automatic initialization of the EGL library.

public static final Configuration<Object>
EGL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the EGL library (org.lwjgl.egl.extensionFilter).

public static final Configuration<String>
EGL_LIBRARY_NAME

Similar to LIBRARY_NAME for the EGL library (org.lwjgl.egl.libname).

public static final Configuration<Boolean>
public static final Configuration<String>
FMOD_FSBANK_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD FSBank library (org.lwjgl.fmod.fsbank.libname).

public static final Configuration<String>
FMOD_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD Core library (org.lwjgl.fmod.libname).

public static final Configuration<String>
FMOD_STUDIO_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD Studio library (org.lwjgl.fmod.studio.libname).

public static final Configuration<String>
FREETYPE_LIBRARY_NAME

Similar to LIBRARY_NAME for the FreeType library (org.lwjgl.freetype.libname).

public static final Configuration<Boolean>
GLFW_CHECK_THREAD0

macOS only: Set this property to false to disable first thread detection on glfwInit.

public static final Configuration<String>
GLFW_LIBRARY_NAME

Similar to LIBRARY_NAME for the GLFW library (org.lwjgl.glfw.libname).

public static final Configuration<Object>
HARFBUZZ_LIBRARY_NAME

Similar to LIBRARY_NAME for the HarfBuzz library (org.lwjgl.harfbuzz.libname).

public static final Configuration<String>
HWLOC_LIBRARY_NAME

Similar to LIBRARY_NAME for the hwloc library (org.lwjgl.hwloc.libname).

public static final Configuration<String>
JAWT_LIBRARY_NAME

Similar to LIBRARY_NAME for the jawt library (org.lwjgl.system.jawt.libname).

public static final Configuration<String>
JEMALLOC_LIBRARY_NAME

Similar to LIBRARY_NAME for the jemalloc library (org.lwjgl.system.jemalloc.libname).

public static final Configuration<Integer>
JNI_NATIVE_INTERFACE_FUNCTION_COUNT

Overrides the number of functions in the JNINativeInterface_ struct.

public static final Configuration<String>
KTX_LIBRARY_NAME

Similar to LIBRARY_NAME for the KTX library (org.lwjgl.ktx.libname).

public static final Configuration<String>
LIBRARY_NAME

Can be used to override the LWJGL library name.

public static final Configuration<String>
LIBRARY_PATH

Takes priority over java.library.path.

public static final Configuration<String>
LLVM_CLANG_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM/Clang Library (org.lwjgl.llvm.clang.libname).

public static final Configuration<String>
LLVM_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM library (org.lwjgl.llvm.libname).

public static final Configuration<String>
LLVM_LTO_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM/LTO library (org.lwjgl.llvm.clang.libname).

public static final Configuration<Object>
MEMORY_ALLOCATOR

Sets the allocator used for the MemoryUtil explicit memory management API (memAlloc/memFree/etc).

public static final Configuration<Boolean>
NFD_LINUX_PORTAL

Set to true to enable NativeFileDialog's XDG Desktop Portal backend on Linux.

public static final Configuration<String>
ODBC_LIBRARY_NAME

Similar to LIBRARY_NAME for the ODBC library (org.lwjgl.odbc.libname).

public static final Configuration<Boolean>
OPENAL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenAL library (org.lwjgl.openal.explicitInit).

public static final Configuration<Object>
OPENAL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenAL library (org.lwjgl.openal.extensionFilter).

public static final Configuration<String>
OPENAL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenAL library (org.lwjgl.openal.libname).

public static final Configuration<Boolean>
OPENCL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenCL library (org.lwjgl.opencl.explicitInit).

public static final Configuration<Object>
OPENCL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenCL library (org.lwjgl.opencl.extensionFilter).

public static final Configuration<String>
OPENCL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenCL library (org.lwjgl.opencl.libname).

public static final Configuration<Boolean>
OPENGL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenGL library (org.lwjgl.opengl.explicitInit).

public static final Configuration<Object>
OPENGL_EXTENSION_FILTER

Can be used to disable specific extensions.

public static final Configuration<String>
OPENGL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenGL library (org.lwjgl.opengl.libname).

public static final Configuration<Object>
OPENGL_MAXVERSION

Can be used to limit the maximum available OpenGL version.

public static final Configuration<String>
OPENGLES_CONTEXT_API

Defines the API that manages OpenGL ES contexts.

public static final Configuration<Boolean>
OPENGLES_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenGL ES library (org.lwjgl.opengles.explicitInit).

public static final Configuration<Object>
OPENGLES_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenGL ES library (org.lwjgl.opengles.extensionFilter).

public static final Configuration<String>
OPENGLES_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenGL ES library (org.lwjgl.opengles.libname).

public static final Configuration<Object>
OPENGLES_MAXVERSION

Similar to OPENGL_MAXVERSION for the OpenGL ES library (org.lwjgl.opengles.maxVersion).

public static final Configuration<String>
OPENVR_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenVR library (org.lwjgl.openvr.libname).

public static final Configuration<Boolean>
OPENXR_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenXR library (org.lwjgl.openxr.explicitInit).

public static final Configuration<String>
OPENXR_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenXR library (org.lwjgl.openxr.libname).

public static final Configuration<String>
OPUS_LIBRARY_NAME

Similar to LIBRARY_NAME for the Opus library (org.lwjgl.opus.libname).

private final String
public static final Configuration<String>
SHADERC_LIBRARY_NAME

Similar to LIBRARY_NAME for the Shaderc libshaderc library (org.lwjgl.shaderc.libname).

public static final Configuration<String>
SHARED_LIBRARY_EXTRACT_DIRECTORY

Changes the temporary directory name created by LWJGL when extracting shared libraries from JAR files.

public static final Configuration<Boolean>
SHARED_LIBRARY_EXTRACT_FORCE

When enabled, shared libraries found as regular files (not inside a JAR file) in the classpath will first be copied to the SHARED_LIBRARY_EXTRACT_PATH, then loaded from there.

public static final Configuration<String>
SHARED_LIBRARY_EXTRACT_PATH

Changes the path where LWJGL extracts shared libraries from JAR files.

public static final Configuration<String>
SPVC_LIBRARY_NAME

Similar to LIBRARY_NAME for the SPIRV-Cross library (org.lwjgl.spvc.libname).

public static final Configuration<Integer>
STACK_SIZE

Sets the stack size, in kilobytes, that will be used in the default MemoryStack constructor.

private volatile T
public static final Configuration<Boolean>
VULKAN_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the Vulkan library (org.lwjgl.vulkan.explicitInit).

public static final Configuration<String>
VULKAN_LIBRARY_NAME

Similar to LIBRARY_NAME for the Vulkan library (org.lwjgl.vulkan.libname).

Constructor Summary

AccessConstructor and Description
pack-priv
Configuration(String property, Configuration.StateInit<? extends T> init)

Method Summary

Modifier and TypeMethod and Description
public T
get()

Returns the option value.

public T
get(T
the default value
defaultValue
)

Returns the option value.

public String
public void
set(T
the value to set
value
)

Sets the option value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARRAY_TLC_SIZEback to summary
public static final Configuration<Integer> ARRAY_TLC_SIZE

Sets the size of arrays cached in thread-local storage to minimize allocations while decoding text.

The memory cost for the cache is up to two arrays per thread that does text decoding. When the text length is up to this value, a cached array will be used. When the text length is longer than this value, a new array buffer will be allocated.

If this option is not set, it defaults to 8192. Setting the value to 0 will disable the array cache.

Property: org.lwjgl.system.arrayTLCSize
   Usage: Static

ASSIMP_DRACO_LIBRARY_NAMEback to summary
public static final Configuration<String> ASSIMP_DRACO_LIBRARY_NAME

Similar to LIBRARY_NAME for the Draco library (org.lwjgl.assimp.draco.libname).

ASSIMP_LIBRARY_NAMEback to summary
public static final Configuration<String> ASSIMP_LIBRARY_NAME

Similar to LIBRARY_NAME for the AssImp library (org.lwjgl.assimp.libname).

BGFX_LIBRARY_NAMEback to summary
public static final Configuration<String> BGFX_LIBRARY_NAME

Similar to LIBRARY_NAME for the BGFX library (org.lwjgl.bgfx.libname).

BUNDLED_LIBRARY_NAME_MAPPERback to summary
public static final Configuration<Object> BUNDLED_LIBRARY_NAME_MAPPER

Sets the mapping algorithm used to resolve the name of bundled shared libraries.

Supported values:

  • default - Maps <libname> to <libname>.
  • legacy - Maps <libname> to is64bit(arch) ? <libname> : <libname>32.
  • <classpath> - A class that implements the Function<String, String> interface. It will be instantiated using reflection.

When set programmatically, it can also be a Function<String, String> instance.

Property: org.lwjgl.system.bundledLibrary.nameMapper
    Type: String or a Function<String, String> instance
   Usage: Static

BUNDLED_LIBRARY_PATH_MAPPERback to summary
public static final Configuration<Object> BUNDLED_LIBRARY_PATH_MAPPER

Sets the mapping algorithm used to resolve bundled shared libraries in the classpath/modulepath.

Supported values:

  • default - Maps <libpath> to <arch>/<libpath>.
  • legacy - Maps <libpath> to <libpath>.
  • <classpath> - A class that implements the Function<String, String> interface. It will be instantiated using reflection.

When set programmatically, it can also be a Function<String, String> instance.

Property: org.lwjgl.system.bundledLibrary.nameMapper
    Type: String or a Function<String, String> instance
   Usage: Static

CUDA_API_PER_THREAD_DEFAULT_STREAMback to summary
public static final Configuration<Boolean> CUDA_API_PER_THREAD_DEFAULT_STREAM

To enable per-thread synchronization, set this option to true before initializing the CUDA driver.

By default, CUDA uses the legacy default stream. To check if the CUDA driver supports PTDS, call org.lwjgl.cuda.CUDA.isPerThreadDefaultStreamSupported()

Property: org.lwjgl.cuda.ptds
   Usage: Static

CUDA_LIBRARY_NAMEback to summary
public static final Configuration<String> CUDA_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA Driver library – nvcuda (org.lwjgl.cuda.libname).

CUDA_NVRTC_BUILTINS_LIBRARY_NAMEback to summary
public static final Configuration<String> CUDA_NVRTC_BUILTINS_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA NVRTC Builtins library (org.lwjgl.cuda.nvrtc-builtins.libname).

CUDA_NVRTC_LIBRARY_NAMEback to summary
public static final Configuration<String> CUDA_NVRTC_LIBRARY_NAME

Similar to LIBRARY_NAME for the CUDA NVRTC library (org.lwjgl.cuda.nvrtc.libname).

CUDA_TOOLKIT_PATHback to summary
public static final Configuration<String> CUDA_TOOLKIT_PATH

This option can be used to load toolkit libraries from a non-standard installation folder.

By default, LWJGL will try to detect CUDA Toolkits in the default installation folder.

Property: org.lwjgl.cuda.toolkit.path
   Usage: Static

CUDA_TOOLKIT_VERSIONback to summary
public static final Configuration<String> CUDA_TOOLKIT_VERSION

This option can be used to force a specific CUDA Toolkit version.

By default, when LWJGL detects multiple CUDA Toolkits, it will use the toolkit with the greatest version.

Property: org.lwjgl.cuda.toolkit.version
   Usage: Static

DEBUGback to summary
public static final Configuration<Boolean> DEBUG

Set to true to enable LWJGL's debug mode.

Information messages will be printed to the APIUtil#DEBUG_STREAM and extra runtime checks will be performed (some potentially expensive, performance-wise).

Property: org.lwjgl.util.Debug
   Usage: Static

DEBUG_FUNCTIONSback to summary
public static final Configuration<Boolean> DEBUG_FUNCTIONS

When enabled, a warning message will be output to DEBUG_STREAM when LWJGL fails to retrieve a function pointer.

This option may generate a lot of output and false negatives for functions in unused classes.

This option requires DEBUG to be enabled.

Property: org.lwjgl.util.DebugFunctions
   Usage: Static

DEBUG_LOADERback to summary
public static final Configuration<Boolean> DEBUG_LOADER

When enabled, SharedLibraryLoader exceptions will be printed to the DEBUG_STREAM.

This option requires DEBUG to be enabled.

Property: org.lwjgl.util.DebugLoader
   Usage: Static

DEBUG_MEMORY_ALLOCATORback to summary
public static final Configuration<Boolean> DEBUG_MEMORY_ALLOCATOR

Set to true to enable LWJGL's debug mode for the MemoryUtil explicit memory management API (memAlloc/memFree/etc).

All memory allocations through that API will be tracked and leaks will be reported on JVM exit. The memReport methods can also be used.

When this option is enabled, a stacktrace is generated on every allocation, which may negatively impact performance. If this becomes a serious issue, the JVM option -XX:MaxJavaStackTraceDepth=d (where d >= 6) can be used to reduce the overhead.

Property: org.lwjgl.util.DebugAllocator
   Usage: Static

DEBUG_MEMORY_ALLOCATOR_FASTback to summary
public static final Configuration<Boolean> DEBUG_MEMORY_ALLOCATOR_FAST

Set to true to skip stacktrace generation on each tracked allocation.

When enabled, this option dramatically reduces the performance overhead of memory leak detection. After a leak is detected, disable this option and rerun the application to get the offending allocation's stacktrace.

This option can also be dynamically toggled on and off, to limit the performance impact in specific portions of the application that are prime suspects for memory leaks.

When reporting memory allocation aggregates, with memReport and the options GROUP_BY_METHOD or GROUP_BY_STACKTRACE, memory allocations without an associated stacktrace will not be included.

Property: org.lwjgl.util.DebugAllocator.fast
   Usage: Dynamic

DEBUG_MEMORY_ALLOCATOR_INTERNALback to summary
public static final Configuration<Boolean> DEBUG_MEMORY_ALLOCATOR_INTERNAL

Set to false to disable tracking of internal memory allocations, in native shared libraries that have been set up to use the LWJGL memory allocator.

If this option is not set, it defaults to true.

Property: org.lwjgl.util.DebugAllocator.internal
   Usage: Static

DEBUG_STACKback to summary
public static final Configuration<Boolean> DEBUG_STACK

Set to true to enable LWJGL's debug mode for the MemoryStack.

When using the stack, each frame should be popped in the same method that pushed it. If this symmetry is broken, this mode will report it immediately.

When this option is enabled, a stacktrace is generated on every push or pop to the stack, which may negatively impact performance. If this becomes a serious issue, the JVM option -XX:MaxJavaStackTraceDepth=d (where d >= 5) can be used to reduce the overhead.

Property: org.lwjgl.util.DebugStack
   Usage: Static

DEBUG_STREAMback to summary
public static final Configuration<Object> DEBUG_STREAM

Can be set to override the default APIUtil#DEBUG_STREAM.

It must be the name of a class that implements the Supplier<PrintStream> interface. The class will be instantiated using reflection and the result of get will become the #DEBUG_STREAM used by LWJGL.

When set programmatically, it can also be a PrintStream instance.

Property: org.lwjgl.util.DebugStream
    Type: String or a PrintStream instance
   Usage: Static

DISABLE_CHECKSback to summary
public static final Configuration<Boolean> DISABLE_CHECKS

Set to true to disable LWJGL's basic checks.

These are trivial checks that LWJGL performs to avoid JVM crashes, very useful during development. Their performance impact is usually minimal, but they may be disabled for release builds.

Property: org.lwjgl.util.NoChecks
   Usage: Static

DISABLE_FUNCTION_CHECKSback to summary
public static final Configuration<Boolean> DISABLE_FUNCTION_CHECKS

Set to true to disable LWJGL's function lookup checks.

These checks ensure that required functions are not missing from dynamically loaded shared libraries. This setting is useful when a trusted incompatible library must be loaded.

Property: org.lwjgl.util.NoFunctionChecks
   Usage: Dynamic

EGL_EXPLICIT_INITback to summary
public static final Configuration<Boolean> EGL_EXPLICIT_INIT

Set this property to false to disable automatic initialization of the EGL library.

By default, LWJGL will automatically initialize the EGL library when it is first accessed.

Property: org.lwjgl.egl.explicitInit
   Usage: Static

EGL_EXTENSION_FILTERback to summary
public static final Configuration<Object> EGL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the EGL library (org.lwjgl.egl.extensionFilter).

EGL_LIBRARY_NAMEback to summary
public static final Configuration<String> EGL_LIBRARY_NAME

Similar to LIBRARY_NAME for the EGL library (org.lwjgl.egl.libname).

EMULATE_SYSTEM_LOADLIBRARYback to summary
public static final Configuration<Boolean> EMULATE_SYSTEM_LOADLIBRARY

EXPERIMENTAL: Emulates System#loadLibrary behavior in Library.loadNative.

Property: org.lwjgl.system.EmulateSystemLoadLibrary
   Usage: Dynamic

FMOD_FSBANK_LIBRARY_NAMEback to summary
public static final Configuration<String> FMOD_FSBANK_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD FSBank library (org.lwjgl.fmod.fsbank.libname).

FMOD_LIBRARY_NAMEback to summary
public static final Configuration<String> FMOD_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD Core library (org.lwjgl.fmod.libname).

FMOD_STUDIO_LIBRARY_NAMEback to summary
public static final Configuration<String> FMOD_STUDIO_LIBRARY_NAME

Similar to LIBRARY_NAME for the FMOD Studio library (org.lwjgl.fmod.studio.libname).

FREETYPE_LIBRARY_NAMEback to summary
public static final Configuration<String> FREETYPE_LIBRARY_NAME

Similar to LIBRARY_NAME for the FreeType library (org.lwjgl.freetype.libname).

GLFW_CHECK_THREAD0back to summary
public static final Configuration<Boolean> GLFW_CHECK_THREAD0

macOS only: Set this property to false to disable first thread detection on glfwInit.

By default, LWJGL will check if glfwInit is called on the first thread of the process. If not, an IllegalStateException will be thrown.

The JVM can be launched with -XstartOnFirstThread to make the main thread the first thread of the process.

Property: org.lwjgl.glfw.checkThread0
   Usage: Dynamic

GLFW_LIBRARY_NAMEback to summary
public static final Configuration<String> GLFW_LIBRARY_NAME

Similar to LIBRARY_NAME for the GLFW library (org.lwjgl.glfw.libname).

HARFBUZZ_LIBRARY_NAMEback to summary
public static final Configuration<Object> HARFBUZZ_LIBRARY_NAME

Similar to LIBRARY_NAME for the HarfBuzz library (org.lwjgl.harfbuzz.libname).

The default LWJGL HarfBuzz build does not include FreeType support and the hb_ft_* functions will not be available. However, LWJGL's FreeType build includes HarfBuzz and exports its full API. When working with both HarfBuzz and FreeType, the HarfBuzz bindings can be made to use FreeType's shared library, with one of the following ways:

  • launch the JVM with -Dorg.lwjgl.harfbuzz.libname=freetype
  • run Configuration.HARFBUZZ_LIBRARY_NAME.set("freetype")
  • run Configuration.HARFBUZZ_LIBRARY_NAME.set(FreeType.getLibrary()) - recommended

The org.lwjgl.harfbuzz.natives module is not necessary when enabling the above.

Property: org.lwjgl.harfbuzz.libname
    Type: String or a SharedLibrary instance
   Usage: Dynamic

HWLOC_LIBRARY_NAMEback to summary
public static final Configuration<String> HWLOC_LIBRARY_NAME

Similar to LIBRARY_NAME for the hwloc library (org.lwjgl.hwloc.libname).

JAWT_LIBRARY_NAMEback to summary
public static final Configuration<String> JAWT_LIBRARY_NAME

Similar to LIBRARY_NAME for the jawt library (org.lwjgl.system.jawt.libname).

JEMALLOC_LIBRARY_NAMEback to summary
public static final Configuration<String> JEMALLOC_LIBRARY_NAME

Similar to LIBRARY_NAME for the jemalloc library (org.lwjgl.system.jemalloc.libname).

JNI_NATIVE_INTERFACE_FUNCTION_COUNTback to summary
public static final Configuration<Integer> JNI_NATIVE_INTERFACE_FUNCTION_COUNT

Overrides the number of functions in the JNINativeInterface_ struct.

This is only necessary when LWJGL runs on a JVM with a newer, unsupported JNI version, that has introduced new JNI functions. The function count must be accurate in order to use the OpenGL, OpenGL ES, or OpenAL bindings.

The currently known values are:

  • 229 for Java 8
  • 230 for Java 9 to Java 18
  • 231 for Java 19 or higher

Property: org.lwjgl.system.JNINativeInterfaceSize
   Usage: Static

KTX_LIBRARY_NAMEback to summary
public static final Configuration<String> KTX_LIBRARY_NAME

Similar to LIBRARY_NAME for the KTX library (org.lwjgl.ktx.libname).

LIBRARY_NAMEback to summary
public static final Configuration<String> LIBRARY_NAME

Can be used to override the LWJGL library name.

It can be an absolute path.

Property: org.lwjgl.libname
   Usage: Dynamic

LIBRARY_PATHback to summary
public static final Configuration<String> LIBRARY_PATH

Takes priority over java.library.path.

It may contain one or more directory paths, separated by File#pathSeparator.

Property: org.lwjgl.librarypath
   Usage: Dynamic

LLVM_CLANG_LIBRARY_NAMEback to summary
public static final Configuration<String> LLVM_CLANG_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM/Clang Library (org.lwjgl.llvm.clang.libname).

LLVM_LIBRARY_NAMEback to summary
public static final Configuration<String> LLVM_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM library (org.lwjgl.llvm.libname).

LLVM_LTO_LIBRARY_NAMEback to summary
public static final Configuration<String> LLVM_LTO_LIBRARY_NAME

Similar to LIBRARY_NAME for the LLVM/LTO library (org.lwjgl.llvm.clang.libname).

MEMORY_ALLOCATORback to summary
public static final Configuration<Object> MEMORY_ALLOCATOR

Sets the allocator used for the MemoryUtil explicit memory management API (memAlloc/memFree/etc).

Supported values:

  • jemalloc - The allocator provided by the jemalloc library.
  • rpmalloc - The allocator provided by the rpmalloc library.

    LWJGL calls rpmalloc_initialize once, when the allocator is created. It never calls rpmalloc_finalize. The user is responsible for calling rpmalloc_thread_initialize and rpmalloc_thread_finalize when appropriate.

  • system - The default system memory allocator
  • <classpath> - A class that implements the MemoryAllocator interface. It will be instantiated using reflection.

When set programmatically, it can also be a MemoryAllocator instance.

Property: org.lwjgl.system.allocator
    Type: String or a MemoryAllocator instance
   Usage: Static

NFD_LINUX_PORTALback to summary
public static final Configuration<Boolean> NFD_LINUX_PORTAL

Set to true to enable NativeFileDialog's XDG Desktop Portal backend on Linux.

Property: org.lwjgl.nfd.linux.portal
   Usage: Static

ODBC_LIBRARY_NAMEback to summary
public static final Configuration<String> ODBC_LIBRARY_NAME

Similar to LIBRARY_NAME for the ODBC library (org.lwjgl.odbc.libname).

OPENAL_EXPLICIT_INITback to summary
public static final Configuration<Boolean> OPENAL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenAL library (org.lwjgl.openal.explicitInit).

OPENAL_EXTENSION_FILTERback to summary
public static final Configuration<Object> OPENAL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenAL library (org.lwjgl.openal.extensionFilter).

OPENAL_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENAL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenAL library (org.lwjgl.openal.libname).

OPENCL_EXPLICIT_INITback to summary
public static final Configuration<Boolean> OPENCL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenCL library (org.lwjgl.opencl.explicitInit).

OPENCL_EXTENSION_FILTERback to summary
public static final Configuration<Object> OPENCL_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenCL library (org.lwjgl.opencl.extensionFilter).

OPENCL_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENCL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenCL library (org.lwjgl.opencl.libname).

OPENGL_EXPLICIT_INITback to summary
public static final Configuration<Boolean> OPENGL_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenGL library (org.lwjgl.opengl.explicitInit).

OPENGL_EXTENSION_FILTERback to summary
public static final Configuration<Object> OPENGL_EXTENSION_FILTER

Can be used to disable specific extensions.

This can be useful to ensure that an application behaves correctly with or without an extension. Supported values:

  • comma-delimited string - A list of extension names to disable.
  • <classpath> - A class that implements the Predicate<String> interface. It will be instantiated using reflection.

When set programmatically, it can also be:

  • a List<String> instance - A list of extension names to disable.
  • a Predicate<String> instance - A predicate that accepts an extension name and returns true if it should be disabled.
OPENGL_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENGL_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenGL library (org.lwjgl.opengl.libname).

OPENGL_MAXVERSIONback to summary
public static final Configuration<Object> OPENGL_MAXVERSION

Can be used to limit the maximum available OpenGL version.

This can be useful to ensure that an application has not accidentally used features only available in a higher OpenGL version. When set programmatically, it can also be an APIUtil.APIVersion instance.

Property: org.lwjgl.opengl.maxVersion
    Type: String (M.n) or an APIUtil.APIVersion instance
   Usage: Static

OPENGLES_CONTEXT_APIback to summary
public static final Configuration<String> OPENGLES_CONTEXT_API

Defines the API that manages OpenGL ES contexts.

Supported values:

  • EGL - context management is provided by EGL.
  • native - context management is provided by the native platform.

If this option is not set, LWJGL will first attempt to use EGL. If EGL is not available, it will attempt to use the native platform API.

Property: org.lwjgl.opengl.contextAPI
    Type: String
   Usage: Dynamic

OPENGLES_EXPLICIT_INITback to summary
public static final Configuration<Boolean> OPENGLES_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenGL ES library (org.lwjgl.opengles.explicitInit).

OPENGLES_EXTENSION_FILTERback to summary
public static final Configuration<Object> OPENGLES_EXTENSION_FILTER

Similar to OPENGL_EXTENSION_FILTER for the OpenGL ES library (org.lwjgl.opengles.extensionFilter).

OPENGLES_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENGLES_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenGL ES library (org.lwjgl.opengles.libname).

OPENGLES_MAXVERSIONback to summary
public static final Configuration<Object> OPENGLES_MAXVERSION

Similar to OPENGL_MAXVERSION for the OpenGL ES library (org.lwjgl.opengles.maxVersion).

OPENVR_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENVR_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenVR library (org.lwjgl.openvr.libname).

OPENXR_EXPLICIT_INITback to summary
public static final Configuration<Boolean> OPENXR_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the OpenXR library (org.lwjgl.openxr.explicitInit).

OPENXR_LIBRARY_NAMEback to summary
public static final Configuration<String> OPENXR_LIBRARY_NAME

Similar to LIBRARY_NAME for the OpenXR library (org.lwjgl.openxr.libname).

OPUS_LIBRARY_NAMEback to summary
public static final Configuration<String> OPUS_LIBRARY_NAME

Similar to LIBRARY_NAME for the Opus library (org.lwjgl.opus.libname).

propertyback to summary
private final String property
SHADERC_LIBRARY_NAMEback to summary
public static final Configuration<String> SHADERC_LIBRARY_NAME

Similar to LIBRARY_NAME for the Shaderc libshaderc library (org.lwjgl.shaderc.libname).

SHARED_LIBRARY_EXTRACT_DIRECTORYback to summary
public static final Configuration<String> SHARED_LIBRARY_EXTRACT_DIRECTORY

Changes the temporary directory name created by LWJGL when extracting shared libraries from JAR files.

If this option is not set, it defaults to lwjgl_<user name>.

Property: org.lwjgl.system.SharedLibraryExtractDirectory
   Usage: Dynamic

SHARED_LIBRARY_EXTRACT_FORCEback to summary
public static final Configuration<Boolean> SHARED_LIBRARY_EXTRACT_FORCE

When enabled, shared libraries found as regular files (not inside a JAR file) in the classpath will first be copied to the SHARED_LIBRARY_EXTRACT_PATH, then loaded from there.

Property: org.lwjgl.system.SharedLibraryExtractForce
   Usage: Dynamic

SHARED_LIBRARY_EXTRACT_PATHback to summary
public static final Configuration<String> SHARED_LIBRARY_EXTRACT_PATH

Changes the path where LWJGL extracts shared libraries from JAR files.

If this option is not set, LWJGL will try the following paths and the first successful will be used:

  • System.getProperty("java.io.tmpdir")/extractDir/version/arch/
  • <working directory>/.extractDir/version/arch/
  • System.getProperty("user.home")/.extractDir/version/arch/
  • Files.createTempDirectory("lwjgl", "")
where:

extractDir = Configuration.SHARED_LIBRARY_EXTRACT_DIRECTORY
version = Version.getVersion().replace(' ', '-')

Property: org.lwjgl.system.SharedLibraryExtractPath
   Usage: Dynamic

SPVC_LIBRARY_NAMEback to summary
public static final Configuration<String> SPVC_LIBRARY_NAME

Similar to LIBRARY_NAME for the SPIRV-Cross library (org.lwjgl.spvc.libname).

STACK_SIZEback to summary
public static final Configuration<Integer> STACK_SIZE

Sets the stack size, in kilobytes, that will be used in the default MemoryStack constructor.

This value is also used for the LWJGL-managed, thread-local, MemoryStack instances. If this option is not set, it defaults to 64.

Property: org.lwjgl.system.stackSize
   Usage: Static

stateback to summary
private volatile T state
Annotations
@Nullable
VULKAN_EXPLICIT_INITback to summary
public static final Configuration<Boolean> VULKAN_EXPLICIT_INIT

Similar to EGL_EXPLICIT_INIT for the Vulkan library (org.lwjgl.vulkan.explicitInit).

VULKAN_LIBRARY_NAMEback to summary
public static final Configuration<String> VULKAN_LIBRARY_NAME

Similar to LIBRARY_NAME for the Vulkan library (org.lwjgl.vulkan.libname).

Constructor Detail

Configurationback to summary
pack-priv Configuration(String property, Configuration.StateInit<? extends T> init)

Method Detail

getback to summary
public T get()

Returns the option value.

If the option value has not been set, null will be returned.

Annotations
@Nullable
getback to summary
public T get(T defaultValue)

Returns the option value.

If the option value has not been set, the specified default value will be returned.

Parameters
defaultValue:T

the default value

getPropertyback to summary
public String getProperty()
setback to summary
public void set(T value)

Sets the option value.

Parameters
value:T

the value to set

org.lwjgl.system back to summary

private Interface Configuration.StateInit<T>

extends Function<String, T>

Field Summary

Modifier and TypeField and Description
public static final Configuration.StateInit<Boolean>
public static final Configuration.StateInit<Integer>
public static final Configuration.StateInit<String>

Method Summary

Inherited from java.util.function.Function:
andThenapplycomposeidentity

Field Detail

BOOLEANback to summary
public static final Configuration.StateInit<Boolean> BOOLEAN
INTback to summary
public static final Configuration.StateInit<Integer> INT
STRINGback to summary
public static final Configuration.StateInit<String> STRING