LibGDX
   HOME

TheInfoList



OR:

libGDX is a
free and open-source Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
game-development application framework written in the
Java programming language Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers ''write once, run anywh ...
with some C and
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
components for performance dependent code. It allows for the development of desktop and mobile games by using the same code base. It is cross-platform, supporting
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
,
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
,
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
, Android,
iOS iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also includes ...
,
BlackBerry The blackberry is an edible fruit produced by many species in the genus ''Rubus'' in the family Rosaceae, hybrids among these species within the subgenus ''Rubus'', and hybrids between the subgenera ''Rubus'' and ''Idaeobatus''. The taxonomy of ...
and
web browsers A web browser is application software for accessing websites. When a User (computing), user requests a web page from a particular website, the browser retrieves its Computer file, files from a web server and then displays the page on the user' ...
with
WebGL WebGL (Short for Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated ...
support.


History

In the middle of 2009 Mario Zechner, the creator of libGDX, wanted to write Android games and started developing a framework called AFX (Android Effects) for this. When he found that deploying the changes from Desktop to Android device was cumbersome, he modified AFX to work on the Desktop as well, making it easier to test programs. This was the first step toward the game framework later known as libGDX. In March 2010 Zechner decided to open-source AFX, hosting it on
Google Code Google Developers (previously Google Code) , application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers usin ...
under the
GNU Lesser General Public License The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
(LGPL). However, at the time he stated that "It's not the intention of the framework to be used for creating desktop games anyway", intending the framework to primarily target Android. In April, it got its first contributor. When Zechner created a
Box2D Box2D is a free open source 2-dimensional physics simulator engine written in C++ by Erin Catto and published under the MIT license. It has been used in ''Crayon Physics Deluxe'', ''Limbo'', ''Rolando'', ''Incredibots'', ''Angry Birds'', ''Tiny ...
JNI In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications (programs specific to a har ...
wrapper, this attracted more users and contributors because physics games were popular at the time. Many of the issues with Android were resolved because of this. Because many users suggested switching to a different license due to LGPL not being suitable for Android, libGDX changed its license to the Apache License 2.0 in July 2010, making it possible to use the framework in closed-source commercial games. The same month its
phpBB phpBB is an Internet forum package written in the PHP scripting language. The name "phpBB" is an abbreviation of ''PHP Bulletin Board''. Available under the GNU General Public License, phpBB is free and open-source. Features of phpBB include s ...
forum was launched. Due to issues with Java Sound the audio desktop implementation switched to
OpenAL OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those ...
in January 2011. Development of a small image manipulation library called Gdx2D was finished as well, which depends on the open source
STB State Security ( cs, Státní bezpečnost, sk, Štátna bezpečnosť) or StB / ŠtB, was the secret police force in communist Czechoslovakia from 1945 to its dissolution in 1990. Serving as an intelligence and counter-intelligence agency, it de ...
library. The rest of 2011 was spent adding a UI library and working on the basics of a 3D API. At the start of 2012 Zechner created a small helper library called gdx-jnigen for easing the development of JNI bindings. This made it possible for the gdx-audio and gdx-freetype extensions to be developed over the following months. Inspired by
Google Google LLC () is an American multinational technology company focusing on search engine technology, online advertising, cloud computing, computer software, quantum computing, e-commerce, artificial intelligence, and consumer electronics. ...
's
PlayN PlayN is an open source Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million p ...
cross-platform game development framework that used
Google Web Toolkit Google Web Toolkit (GWT ), or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under the Apache License 2.0. GWT emphasizes reusable ...
(GWT) to compile Java to
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
code, Zechner wrote an
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
/JavaScript backend over the course of several weeks, which allowed libGDX applications to be run in any browser with
WebGL WebGL (Short for Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated ...
support. After Google abandoned PlayN, it was maintained by Michael Bayne, who added
iOS iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also includes ...
support to it. libGDX used parts of this work for its own
MonoTouch Mono is a free and open-source .NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the .NET Foundation. Mono can be run on many softwa ...
-based backend. In August 2012 the project switched its
version control system In software engineering, version control (also known as revision control, source control, or source code management) is a class of systems responsible for managing changes to computer programs, documents, large web sites, or other collections o ...
from
Subversion Subversion () refers to a process by which the values and principles of a system in place are contradicted or reversed in an attempt to transform the established social order and its structures of power, authority, hierarchy, and social norms. Sub ...
to
Git Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data inte ...
, moving from Google Code to
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous ...
. However, the issue tracker and wiki remained on Google Code for another year. The main build system was also changed to
Maven MAVEN is an American spacecraft orbiting Mars to study the loss of its atmospheric gases to space, providing insight into the history of the planet's climate and water. The spacecraft name is an acronym for "Mars Atmosphere and Volatile Evolu ...
, making it easier for developers with different IDEs to work together. Because of issues with the MonoTouch iOS backend Niklas Thernig wrote a RoboVM backend for libGDX in March 2013, which was integrated into the project in September. From March to May 2013 a new 3D API was developed as well and integrated into the library. In June 2013 the project's website was redone, now featuring a gallery where users can submit their games created with libGDX. more than 3000 games have been submitted. After the source code migration to GitHub the year before, in September 2013 the issue tracker and wiki were also moved there from Google Code. The same month the build and dependency management system was switched from Maven to
Gradle Gradle is a build automation tool for multi-language software development. It controls the development process in the tasks of compilation and packaging to testing, deployment, and publishing. Supported languages include Java (as well as Kotli ...
. After a cleanup phase in the first months of 2014 libGDX version 1.0 was released on 20 April, more than four years after the start of the project. In 2014 libGDX was one of the annual Duke's Choice Award winners, being chosen for its focus on platform-independence. In April 2016 it was announced that libGDX would switch to
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
's Multi-OS Engine on the iOS backend after the discontinuation of RoboVM. With the release of libGDX 1.9.3 on 16 May 2016 Multi-OS is provided as an alternative, while by default the library uses its own fork of the open source version of RoboVM.


libGDX Jam

From 18 December 2015 to 18 January 2016 a libGDX
game jam A game jam is an event where participants try to make a video game from scratch. Depending on the format, participants might work independently, or in teams. The event duration usually ranges from 24 to 72 hours. Participants are generally program ...
was organized together with RoboVM,
itch.io Itch.io (stylized as itch.io) is a website for users to host, sell and download indie games. Launched in March 2013 by Leaf Corcoran, the service hosts over 500,000 games and items (assets, ebooks, music) . Itch.io also allows users to host ...
and Robotality. From initially 180 theme suggestions "Life in space" was chosen as the jam's main theme, and 83 games were created over the course of the competition.


Release versions


Architecture

libGDX allows the developer to write, test, and debug their application on their own desktop PC and use the same code on Android. It abstracts away the differences between a common Windows/Linux application and an Android application. The usual development cycle consists of staying on the desktop PC as much as possible while periodically verifying that the project still works on Android. Its main goal is to provide total compatibility between desktop and mobile devices, the main difference being speed and processing power.


Backends

The library transparently uses platform-specific code through various backends to access the capabilities of the host platform. Most of the time the developer does not have to write platform-specific code, except for starter classes (also called launchers) that require different setup depending on the backend. * On the desktop the
Lightweight Java Game Library 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 a ...
(LWJGL) is used. There is also an experimental JGLFW backend that is not being continued anymore. In Version 1.8 a new backend was introduced, intended to replace the older backend. * The HTML5 backend uses the
Google Web Toolkit Google Web Toolkit (GWT ), or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under the Apache License 2.0. GWT emphasizes reusable ...
(GWT) for compiling the Java to JavaScript code, which is then run in a normal browser environment. libGDX provides several implementations of standard APIs that are not directly supported there, most notably
reflection Reflection or reflexion may refer to: Science and technology * Reflection (physics), a common wave phenomenon ** Specular reflection, reflection from a smooth surface *** Mirror image, a reflection in a mirror or in water ** Signal reflection, in ...
. * The Android backend runs Java code compiled for Android with the
Android SDK The Android SDK is a software development kit that includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development ...
. * For iOS a custom
fork In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ei ...
of RoboVM is used to compile Java to native iOS instructions.
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
's Multi-OS Engine has been provided as an alternative since the discontinuation of RoboVM.


Other JVM languages

While libGDX is written primarily in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
, the compiled
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
is language-independent, allowing many other
JVM languages This list of JVM Languages comprises notable computer programming languages that are used to produce computer software that runs on the Java virtual machine (JVM). Some of these languages are interpreted by a Java program, and some are compiled ...
to directly use the library. The documentation specifically states the interoperability with
Ceylon Sri Lanka (, ; si, ශ්‍රී ලංකා, Śrī Laṅkā, translit-std=ISO (); ta, இலங்கை, Ilaṅkai, translit-std=ISO ()), formerly known as Ceylon and officially the Democratic Socialist Republic of Sri Lanka, is an ...
,
Clojure Clojure (, like ''closure'') is a dynamic and functional dialect of the Lisp programming language on the Java platform. Like other Lisp dialects, Clojure treats code as data and has a Lisp macro system. The current development process is comm ...
, Kotlin,
Jython Jython is an implementation of the Python programming language designed to run on the Java platform. The implementation was formerly known as JPython until 1999. Overview Jython programs can import and use any Java class. Except for some standa ...
,
JRuby JRuby is an implementation of the Ruby programming language atop the Java Virtual Machine, written largely in Java. It is free software released under a three-way EPL/GPL/LGPL license. JRuby is tightly integrated with Java to allow the embedding ...
and Scala.


Extensions

Several official and third-party extensions exist that add additional functionality to the library.


gdxAI

An
artificial intelligence Artificial intelligence (AI) is intelligence—perceiving, synthesizing, and inferring information—demonstrated by machines, as opposed to intelligence displayed by animals and humans. Example tasks in which this is done include speech re ...
(AI) framework that was split from the main library with version 1.4.1 in October 2014 and moved into its own repository. While it was initially made for libGDX, it can be used with other frameworks as well. The project focuses on AI useful for games, among them
pathfinding Pathfinding or pathing is the plotting, by a computer application, of the shortest route between two points. It is a more practical variant on solving mazes. This field of research is based heavily on Dijkstra's algorithm for finding the sh ...
,
decision making In psychology, decision-making (also spelled decision making and decisionmaking) is regarded as the cognitive process resulting in the selection of a belief or a course of action among several possible alternative options. It could be either rati ...
and movement.


gdx freetype

Can be used to render FreeType fonts at run time instead of using static
bitmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that c ...
images, which do not scale as well.


Box2D

A wrapper for the
Box2D Box2D is a free open source 2-dimensional physics simulator engine written in C++ by Erin Catto and published under the MIT license. It has been used in ''Crayon Physics Deluxe'', ''Limbo'', ''Rolando'', ''Incredibots'', ''Angry Birds'', ''Tiny ...
physics library was introduced in 2010 and moved to an extension with the 1.0 release.


packr

A helper tool that bundles a custom JRE with the application so end users do not have to have their own one installed.


Notable games

* '' Drag Racing: Streets'' * ''
Ingress Ingress may refer to: Science and technology * Ingress (signal leakage), the passage of an outside signal into a coaxial cable * Ingress filtering, a computer network packet filtering technique * Ingress protection rating, a protection level that ...
'' (before it was relaunched as ''Ingress Prime'') * ''
Slay the Spire ''Slay the Spire'' is a roguelike deck-building video game developed by American studio MegaCrit and published by Humble Bundle. The game was first released in early access for Microsoft Windows, macOS, and Linux in late 2017, with an official rel ...
'' * '' Delver'' * ''
HOPLITE Hoplites ( ) ( grc, ὁπλίτης : hoplítēs) were citizen-soldiers of Ancient Greece, Ancient Greek Polis, city-states who were primarily armed with spears and shields. Hoplite soldiers used the phalanx formation to be effective in war with ...
'' * '' Deep Town'' * '' Sandship'' * '' Unciv'' * '' Mindustry'' * '' Space Haven'' * ''Pathway'' * ''Halfway'' * '' Riiablo'' * '' Mirage Realms'' * ''Raindancer'' * '' PokeMMO'' * '' Zombie Age 3'' * '' Epic Heroes War'' * '' Shattered Pixel Dungeon'' * '' Hair Dash'' * '' Antiyoy'' * '' Wildermyth''


See also

* *


References


External links

* {{Java desktop Audio libraries Cross-platform free software Free 3D graphics software Free computer libraries Free game engines Free graphics software Free software programmed in Java (programming language) Graphics libraries Java APIs Java (programming language) libraries OpenGL Software using the Apache license Video game development software Video game engines