What Java Library Does Minecraft Use?
Minecraft is a sandbox video game created by Swedish game designer Markus Persson and later developed by Mojang. It used LWJGL, a Java library, for graphics.
If you’re a Java developer and want to get into game development, you’ve probably heard about LWJGL. LWJGL stands for Lightweight Java Games Library and is a popular way to make games in Java.
LWJGL is a Java library for handling hardware-accelerated graphics. It can be used in games and other applications that require heavy use of graphical display functions. The library works on many platforms, including; iOS, Android, Linux, Mac OS X and Windows.
The LWJGL Wiki describes its purpose as follows: “The main goal of the project is to provide a rich set of reusable software libraries and technologies for use in developing high performance, cross-platform games.”
The library has four main components. They are:
- GL - A cross-platform abstraction layer used to access native OpenGL capabilities
- JNI - Java Native Interface that allows Java code to call into native code and vice versa
- IO - Input/Output interface which allows asynchronous reading from various sources, such as files or network streams
- Media - Media interface which provides an abstraction layer for working with sound, video and other multimedia related tasks. Some examples include: playing sound samples or decoding media encoded using various formats (such as MPEG-4).
It provides a simple interface to OpenGL (hardware-accelerated 3D) and OpenAL (hardware-accelerated audio) and abstracts away the underlying differences between operating systems (OS).
It also has an optional package for DirectInput support for gamepads, joysticks and mice. LWJGL is an alternative to Java3D, which provides functionality similar to OpenGL. In addition, it also provides features that allow developers to create 2D games.
With Eiliana, you can create a second source of income for yourself. The platform connects you with clients from across the world who need Java game code.
Read next Elixir 1.13 released: The developer’s point of view