SkillAgentSearch skills...

Lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.

Install / Use

/learn @LWJGL/Lwjgl3

README

Maven Central API Javadoc License

Size Build Status

LWJGL - Lightweight Java Game Library 3

LWJGL (https://www.lwjgl.org) is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL/Vulkan), audio (OpenAL) and parallel computing (OpenCL) applications. This access is direct and high-performance, yet also wrapped in a type-safe and user-friendly layer, appropriate for the Java ecosystem.

LWJGL is an enabling technology and provides low-level access. It is not a framework and does not provide higher-level utilities than what the native libraries expose. As such, novice programmers are encouraged to try one of the frameworks or game engines that make use of LWJGL, before working directly with the library.

LWJGL is open source software and freely available at no charge.

Useful links:

Contact:

If you'd like to contribute, see doc/README for a quick overview of the project structure, installation instructions and configuration options.

Getting Started

As of version 3.4.0 and JDK 25, LWJGL supports the FFM API and is fully functional when running with --sun-misc-unsafe-memory-access=deny. See the FFM documentation for details.

As of version 3.1.0, LWJGL is distributed as a set of modules. Only the core module is required and all bindings are optional (but some bindings depend on other bindings). The easiest way to download LWJGL is to use the build configurator on the website.

The build configurator generates Maven & Gradle declarations that can be added to existing projects. This is the easiest way to use LWJGL while developing.

LWJGL can also be downloaded as a simple set of JAR files. Each module consists of the following files:

  • lwjgl-<module>.jar
  • lwjgl-<module>-sources.jar
  • lwjgl-<module>-javadoc.jar
  • lwjgl-<module>-natives-<platform>.jar (for some bindings)

To compile and run an LWJGL application, the base and natives JAR files of the core module and each binding used should be added to the classpath. LWJGL extracts the natives to a temporary folder and loads them automatically, so no further configuration is necessary. If more customization is required (e.g. when creating a platform-specific installer) the natives may be extracted manually and loaded via java.library.path. See the Configuration class for more options.

LWJGL 3 requires Java 8 or later to build and run and currently supports the following platforms/architectures:

  • FreeBSD x64
  • Linux x64
  • Linux arm64 (ARMv8/AArch64)
  • Linux arm32 (ARMv7/armhf)
  • Linux ppc64le
  • Linux riscv64
  • macOS x64
  • macOS arm64
  • Windows x64
  • Windows x86
  • Windows arm64

Example code:

For migrating LWJGL 2 code to LWJGL 3, see the Migration Guide.

Troubleshooting

Most common issues faced by LWJGL users are trivially addressed with the following:

LWJGLX/debug is a Java Agent that will automatically detect a lot of these issues. It can also generate a trace log that's useful when reporting issues to LWJGL.

When asking for help or when you suspect a bug in LWJGL, preparing an MVCE (Minimal, Complete, and Verifiable example) that reproduces the issue will improve the chances of a quick and useful response.

List of Supported Bindings

Khronos APIs

| Library| Description| |--------|------------| | EGL| An interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.| | KTX (Khronos Texture)| A lightweight container for textures for OpenGL®, Vulkan® and other GPU APIs.| | OpenCL| An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms.| | OpenGL| The most widely adopted 2D and 3D graphics API in the industry, bringing thousands of applications to a wide variety of computer platforms.| | OpenGL ES| A royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles.| | OpenXR| A royalty-free, open standard that provides high-performance access to Augmented Reality (AR) and Virtual Reality (VR)—collectively known as XR—platforms and devices.| | Vulkan| A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.|

Display and Input

| Library| Description| |--------|------------| | GLFW| Create multiple windows, handle user input (keyboard, mouse, gaming peripherals) and manage contexts. Also features multi-monitor support, clipboard access, file drag-n-drop, and much more.| | SDL| Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL/Direct3D/Metal/Vulkan.| | JAWT| The AWT native interface.| | Native File Dialog Extended| A small C library that portably invokes native file open, folder select and file save dialogs.| | tinyfd| A native dialog library.|

Audio

| Library| Description| |--------|------------| | FMOD| An end-to-end solution for adding sound and music to any game.| | OpenAL| A cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications.| | OpenAL Soft| An LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.| | Opus| A totally open, royalty-free, highly versatile audio codec.|

Graphics

| Library| Description| |--------|------------| | Assimp| A portable Open Source library to import various well-known 3D model formats in a uniform manner.| | bgfx| Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library, licensed under permissive BSD-2 clause open source license.| | FreeType| A freely available software library to render fonts.| | HarfBuzz| A text shaping library that allows programs to convert a sequence of Unicode input into properly formatted and positioned glyph output — for any writing system and language.| | meshoptimizer| A mesh optimization library that makes meshes smaller and faster to render.| | msdfgen| A multi-channel signed distance field generator.| | NanoSVG| A simple stupid SVG parser.| | NanoVG| A small antialiased vector graphics rendering library for OpenGL.| | Nuklear| A minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain.| | par_octasphere| Generates triangle meshes for spheres, rounded boxes, and capsules.| | par_shapes| Generate parametric surfaces and other simple shapes.| | par_streamlines| Triangulate wide lines and curves.| | Shaderc| A collection of libraries for shader compilation.| | SPIRV-Cross|

View on GitHub
GitHub Stars5.3k
CategoryDevelopment
Updated10h ago
Forks690

Languages

Java

Security Score

100/100

Audited on Mar 27, 2026

No findings