LWJGL explained

LWJGL
Lightweight Java Game Library (LWJGL)
Author:Caspian Prince
Developer:Ioannis Tsakpinis
Latest Release Version:3.3.4
Programming Language:Java, C, Kotlin
Operating System:Linux, macOS, Windows, FreeBSD
Platform:Java platform
Genre:Free computer library
License:BSD, some bindings under different licenses

The Lightweight Java Game Library (LWJGL) is an open-source software library that provides bindings to a variety of C libraries for video game developers to Java. It exposes cross-platform libraries commonly used in developing video games and multimedia titles, such as Vulkan, OpenGL, OpenAL and OpenCL.

The primary goal of the project is to provide a way for Java developers to get access to resources that are otherwise unavailable or poorly implemented on the existing Java platform. The main philosophy is to expose underlying technology as a thin wrapper, thus creating an API close to the original. It is also the basis of many high-level Java game engines and libraries, such as libGDX or the jMonkeyEngine.

History

Development of the library began in 2002 with the release of J2SE 1.4, making use of the newly-added non-blocking I/O operations and off-heap memory access. These additions to the JDK allowed for better access to native memory and libraries not a part of the JDK. The first official release of the library was on 4 February 2007.[1]

On 13 November 2014, version 3 was announced, which was released in the alpha version on 27 April 2015 and is a complete rewrite of LWJGL.[2] [3] [4] Many new bindings, including GLFW, EGL and Objective-C, were added. Support for Oculus Rift development was also added with LibOVR bindings.[5] The new version was released on 4 June 2016, after more than 3 and a half years in development.[6]

Bindings

The library accesses native C code through the Java Native Interface (JNI). Bindings to each of the native libraries exist as different modules so developers can make custom builds with only the things they need in a certain program.[7]

While utility classes are written in pure Java, most of the binding classes are automatically generated by a custom generator implemented in Kotlin.[8] [9]

Since version 3.1, LWJGL is fully split into 51 modules that can be downloaded and used separately. To make this process easier, the project provides an online build configurator, which allows users to download custom combinations of modules and automatically generates Maven and Gradle configuration files to ease their use with existing projects.[10] [11] [12]

Provided bindings! Binding!Category! Description! Notes
EGLKhronos APIsInterface between Khronos rendering APIs and the underlying native platform window system.
OpenCLAPI for cross-platform parallel computing.
OpenGL3D graphics specification implemented by most GPU vendors.Most extensions are supported, but less popular ones will be added on request.
OpenGL ESOpenGL for embedded systems like mobile phones, tablets, or consoles.
VulkanUpcoming cross-platform 3D graphics API.
GLFWDisplay and InputWindow management library needed for handling OpenGL and Vulkan contexts as well as user input.
JAWTAWT native interface.
nfdSmall cross-platform native file dialogs library.
tinyfdSmall native dialog library.
OpenALAudioThree-dimensional audio API.ALC and other extensions are supported. Specifically bundles the OpenAL Soft implementation.
OpusOpen, royalty-free audio codec.
AssimpGraphicsPortable open source library to import various 3D model formats.
bgfxCross-platform rendering library supporting multiple graphics backends.
DriftFXLibrary to render OpenGL content into JavaFX nodes.
LibOVRAPI of the Oculus Rift SDK.
meshoptimizerA mesh optimization library that makes meshes smaller and faster to render
NanoSVGSimple SVG parser.
NanoVG2D vector graphics rendering library using OpenGL.
NuklearSimple GUI library.
par_shapesGenerator for parametric and other simple shapes.
par_streamlinesTriangulate wide lines and curves.
OpenVRAn API runtime that allows access to VR hardware from multiple vendors without requiring applications have specific knowledge of the type of hardware they are targeting.
ShadercA collection of libraries for shader compilation
SPIRV-CrossA library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
OpenEXRA small, single-header library to load and save OpenEXR (.exr) images.
Tootle (AMD)A 3D triangle mesh optimization library that improves on existing mesh preprocessing techniques.
Vulkan Memory AllocatorAn easy to integrate Vulkan memory allocation library.
YogaAn open-source, cross-platform layout library that implements CSS Flexbox.
STBSTBLightweight single-file libraries for loading images, sounds and fonts.
Bullet PhysicsOtherReal-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine-learning, etc.
CUDAA parallel computing platform and programming model developed by NVIDIA for general computing on GPUs.
dyncallLibrary for dynamically calling C functions in a portable way.Set to be removed.
jemallocLow-level memory management.
libffiA portable, high level programming interface to various calling conventions.Replaces dyncall.
libdivideA library that replaces expensive integer divides with comparatively cheap multiplication and bitshifts.
LLVMA collection of modular and reusable compiler and toolchain technologies.
LMDBFast database library using memory-mapped files.
LZ4A lossless data compression algorithm that is focused on speed.
Meow HashFast non-cryptographic hash.
ODBCA C-language interface that makes it possible for applications to access data from a variety of database management systems.
RemoteryRealtime CPU/GPU profiler.
rpmallocCross-platform thread caching memory allocator.
xxHashFast hash algorithm.
ZstandardA fast lossless compression algorithm.

Notable uses

Notes and References

  1. Web site: Matzon . Brian . 4 February 2007 . LWJGL 1.0 Released . 23 July 2016 . LWJGL Forum.
  2. Web site: Welcome to LWJGL 3 . blog.lwjgl.org . 13 November 2014 . Ioannis . Tsakpinis.
  3. Web site: LWJGL 3 Roadmap . . 2 June 2015.
  4. Web site: LWJGL 3.0.0a released . blog.lwjgl.org . 27 April 2015 . Ioannis . Tsakpinis.
  5. Web site: Official website . 14 August 2015.
  6. Web site: 4 June 2016 . LWJGL 3.0.0 Released! . 4 June 2016 . blog.lwjgl.org.
  7. Web site: Bindings FAQ . . 27 December 2014 . 27 July 2015.
  8. Web site: LWJGL/lwjgl3 . . 13 August 2016.
  9. Web site: lwjgl3/doc – Generator . . 11 August 2015 . 30 August 2015.
  10. News: LWJGL 3.1.0 Released!. blog.lwjgl.org. 30 October 2016. 11 November 2016.
  11. News: Minecraft unblocked . 16 November 2023.
  12. Web site: Download – LWJGL. lwjgl.org. 11 November 2016.
  13. Web site: Minecraft Attributions Minecraft. 9 July 2020. Minecraft.net.
  14. Web site: 2014-02-17. APZDTISA #3: This time with LIVE MULTIPLAYER!. 2022-01-25. Project Zomboid.