Introduction to LWJGL

What is LWJGL?

LWJGL stands for LightWeight Java Game Library. It is the base of creating games with the Java language. There are many other API’s that can develop games, but one way or another, they eventually extend off LWJGL, but you can program games just as good with LWJGL. This set of tutorials will show you how to do just that.

LWJGL uses OpenGL and OpenAL, as well as an abundance of other utilitiies and tools to create a game. OpenGL and OpenAL are the main ones, as this is what the utilities run on. Java’s version of OpenGL/AL already comes when you donwload LWJGL, so you do not need to update your system’s OpenGL at all.

OpenGL is all about graphic display and rendering graphics in 2D or 3D view. There are much more complicated processes with 3D games, therefore we would not go into that in this tutorial, the game that we will make will be in 2D. OpenAL is for playing audio within your game at certian distances/locations in your game, etc. All of the physics with sound is included with OpenAL, so you don’t need to worry about that when coding.

Prerequisites

Before we get started into programming a game, you first need to have an understanding of the Java language itself. There is a set of Java tutorials in this website! You can find them here.

You also need the LWJGL library itself. You can find that here.

Programming workspace

You need an application to program Java in. We highly recommend that you use Eclipse. We recommend this because it is easy to set up an LWJGL project with, and it is just great. There is a tutorial on setting up eclipse here at the Download required software section if you do not already have Eclipse. A link to download it is also in that section.

Let’s Begin!

Lets start our project where we will make a simple 2D Pong game. Click the ‘Next’ button to continue!

Next »