Jump to content

LibGDX

From Alfawiki
Adapted from the English Wikipedia article LibGDX, available under CC BY-SA 4.0Updated 9 August 2025
libGDX
Company typeOpen-source software framework
IndustryGame development
Founded2009
FounderMario Zechner
Area served
Cross-platform (Windows, Linux, macOS, Android, iOS, BlackBerry, Web browsers)
ProductsGame development framework
Websitelibgdx.badlogicgames.com

libGDX is an open-source and cost-free framework designed for game development, primarily implemented in Java, with select portions written in C and C++ to optimize performance-critical sections. It allows developers to build games for both desktop and mobile platforms using a unified codebase, supporting operating systems such as Windows, Linux, macOS, Android, iOS, BlackBerry, as well as web browsers through WebGL.

History

The origins of libGDX trace back to 2009 when Mario Zechner initiated the creation of AFX (Android Effects), a tool aimed at simplifying game development on Android. To facilitate easier testing, he adapted AFX to function on desktop environments, which ultimately served as the foundation for libGDX.

In March 2010, Zechner released AFX under the LGPL license on Google Code, initially targeting Android development. Later that year, in October, Nathan Sweet joined the project as a significant contributor and eventually became a co-copyright holder.

The addition of a JNI wrapper for Box2D attracted developers interested in physics-based gameplay and helped resolve numerous Android-specific challenges. Taking community input into account, libGDX transitioned to the more commercially permissive Apache License 2.0 in July 2010, allowing its integration into proprietary games. That same month marked the launch of its phpBB-based discussion forum.

By January 2011, libGDX had replaced its desktop audio system from Java Sound to OpenAL to enhance audio performance and introduced Gdx2D, an image processing library built upon the open-source STB library.

Throughout 2011, the framework expanded by incorporating a user interface toolkit and initiating work on a 3D application programming interface.

Early in 2012, the team released gdx-jnigen, a utility library that streamlined JNI binding creation, enabling additional modules such as gdx-audio and gdx-freetype.

Drawing inspiration from Google's PlayN framework, Zechner developed an HTML/JavaScript backend that allowed libGDX applications to operate within WebGL-capable browsers. After Google discontinued PlayN's development, libGDX enhanced its iOS support by adopting a MonoTouch-based backend.

In August 2012, libGDX shifted its version control system from Subversion hosted on Google Code to Git on GitHub and migrated its build management to Apache Maven to foster better collaboration among developers.

To overcome limitations with the MonoTouch iOS backend, Niklas Thernig created a RoboVM backend in early 2013; this was incorporated into libGDX later that year. Additionally, between March and May 2013, a new 3D API was launched.

June 2013 brought an updated website featuring a gallery showcasing user-submitted games; by January 2016, this collection had grown to include over 3,000 titles.

By September 2013, issue tracking and wiki hosting were fully transferred to GitHub. At the same time, Gradle replaced Maven as the preferred build and dependency management tool.

Following a period of refinement and cleanup, libGDX version 1.0 was officially released on 20 April 2014. That year, it earned a Duke's Choice Award recognizing its platform-independent approach to Java game development.

After RoboVM was discontinued in April 2016, libGDX announced support for Intel's Multi-OS Engine as an alternative iOS backend. With the launch of version 1.9.3 in May 2016, Multi-OS Engine became available alongside a maintained fork of RoboVM for iOS development.

libGDX Jam

Between 18 December 2015 and 18 January 2016, a libGDX game jam was hosted in collaboration with RoboVM, itch.io, and Robotality. From a pool of 180 theme proposals, "Life in space" was chosen, inspiring the creation of 83 games throughout the event.

Release versions

Version Release date
Template:Version 20 April 2014
Template:Version 23 May 2014
Template:Version 22 June 2014
Template:Version 9 August 2014
Template:Version 10 October 2014
Template:Version 8 December 2014
Template:Version 6 May 2015
Template:Version 21 September 2015
Template:Version 5 January 2016
Template:Version 24 January 2016
Template:Version 18 April 2021
Template:Version 11 May 2022
Template:Version 2 July 2023
Template:Version 17 October 2024

Architecture

libGDX permits developers to create, test, and debug applications on desktop computers while utilizing the same codebase for Android devices. It abstracts platform-specific differences between desktop operating systems (Windows/Linux) and Android, enabling a development workflow primarily centered on desktop environments with occasional Android testing phases. The framework’s main objective is to ensure smooth cross-platform compatibility, with the main variations lying in performance and hardware capabilities.

Backends

To leverage host system features, libGDX employs platform-tailored backends, generally requiring minimal platform-dependent coding aside from launcher classes that handle initialization unique to each backend.

  • For desktop platforms, libGDX relies on the Lightweight Java Game Library (LWJGL). Starting with version 1.8, the newer backend replaced the previous one. An experimental JGLFW backend was once available but has since been discontinued.
  • The HTML5 backend converts Java source into JavaScript using Google Web Toolkit (GWT), enabling applications to run within web browsers. To accommodate this environment’s limitations, libGDX implements certain APIs such as reflection that are not natively supported by browsers.
  • On Android devices, the backend executes Java code compiled through the Android SDK.
  • For iOS platforms, a specialized fork of RoboVM translates Java into native machine code. After RoboVM ceased development, Intel's Multi-OS Engine emerged as an alternative solution.

Other JVM languages

While libGDX is predominantly authored in Java, its outputted Java bytecode is agnostic to programming languages, allowing usage with numerous List of JVM languages. The official documentation emphasizes compatibility with languages such as Ceylon, Clojure, Kotlin, Jython, JRuby, and Scala.

Extensions

A variety of both official and community-developed extensions exist to broaden libGDX’s capabilities.

gdxAI

Originally part of the core library until version 1.4.1 (October 2014), this AI framework was separated into its own repository. Although primarily created for libGDX projects, it also supports other engines and concentrates on game-centric AI functionality including pathfinding, decision-making processes, and movement control.

gdx freetype

Facilitates dynamic rendering of FreeType fonts during execution, providing enhanced scalability compared to fixed bitmap graphics.

Box2D

An interface for the Box2D physics engine introduced in 2010, which was later shifted to an extension format starting with the 1.0 version.

packr

A deployment utility that packages a tailored JRE alongside applications, removing the requirement for users to separately install a JRE.

Notable games and apps

See also

External links