7
\$\begingroup\$

I've been looking into developing a small game with Java, as I am fairly familiar with it and see game development as good opportunity to improve my knowledge. When I research different libraries and other such things, the two resources I have often seen are LibGDX and LWJGL. I am however still unsure of the differences between the two. Would someone be able to explain where the differences lie and what each's strength is.

\$\endgroup\$

4 Answers 4

7
\$\begingroup\$

LibGDX is based on LWGL and its advantage are that a lot of the base stuff is already written and you don't need to write it. Some people prefer to write it themselves though. LibGDX is generally used in mobile game development, but can also be used on Windows, Mac and Html.

Some final words: For beginners I would suggest using LibGDX, because it is easier to understand and LWJGL is very complicated for beginners.

\$\endgroup\$
0
4
\$\begingroup\$

LWJGL is Lightweight Java Game Library. It is not engine.

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL), 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.

More info you can find at LWJGL site

LibGDX is based on LWJGL java game development framework.

Libgdx is a Java game development framework that provides a unified API that works across all supported platforms.

The framework provides an environment for rapid prototyping and fast iterations. Instead of deploying to Android/iOS/Javascript after each code change, you can run and debug your game on the desktop, natively. Desktop JVM features like code hotswapping reduce your iteration times considerably.

More info you can find at LibGDX site

\$\endgroup\$
1
  • \$\begingroup\$ It's not an engine! It's a game framework. \$\endgroup\$
    – Ghandhikus
    Commented Aug 28, 2017 at 20:04
1
\$\begingroup\$

LWJGL is simply a wrapper for the C libraries OpenGL, OpenAL and OpenCL. It provides access to the raw functions that the C libraries provide.

With LWJGL as it's core, LibGDX provides a framework. It provides a gameloop,a rendering system, an audio system as well as other features. LibGDX abstracts the basic LWJGL interface from you. It provides an Object-Oriented package to make games.

\$\endgroup\$
0
\$\begingroup\$

LWJGL is a low level framework that includes window creation, input handling and other low level features. Libgdx is a full featured 2d and 3d game framework that is built on top of LWJGL.

The typical workflow for drawing a triangle on screen with LWJGl is: 1- Create a window using the included GLFW3 framework. 2- Create an Opengl context using the built in functionality that come with GLFW. 3- Call OpenGL and draw your triangle. Each step will take a lot of coding.

The workflow for Libgdx is: 1- Setup the project using the provided GUI tool. 2- Build and run the generated project and you have example code that loads an image and displays it. In Libgdx all the low level stuff is handled for you and you just have to worry about designing and developing your game.

If you want to make a game as quickly as possible then go with the JmonkeyEngine. The engine lets you go low level if you need to(the LWJGL route) or the Libgdx way but with a GUI engine included.

If your goal is to learn java without the game development quirks then just use JavaFx or the Java Canvas and push out your games. This will be easiest route to take and you will be working with Java APIs more than dealing with game development specific details.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .