- Learning Libgdx Game Development
- Andreas Oehlke
- 338字
- 2021-08-06 16:38:54
Backends
Libgdx makes use of several other libraries to interface the specifics of each platform in order to provide cross-platform support for your applications. Generally, a backend is what enables Libgdx to access the corresponding platform functionalities when one of the abstracted (platform-independent) Libgdx methods is called. For example, drawing an image to the upper-left corner of the screen, playing a sound file at a volume of 80 percent, or reading and writing from/to a file.
Libgdx currently provides the following three backends:
- LWJGL (Lightweight Java Game Library)
- Android
- JavaScript/WebGL
As already mentioned in Chapter 1, Introduction to Libgdx and Project Setup, there will also be an iOS backend in the near future.
LWJGL (Lightweight Java Game Library)
LWJGL (Lightweight Java Game Library) is an open source Java library originally started by Caspian Rychlik-Prince to ease game development in terms of accessing the hardware resources on desktop systems. In Libgdx, it is used for the desktop backend to support all the major desktop operating systems, such as Windows, Linux, and Mac OS X.
For more details, check out the official LWJGL website at http://www.lwjgl.org/.
Android
Google frequently releases and updates their official Android SDK. This represents the foundation for Libgdx to support Android in the form of a backend.
There is an API Guide available which explains everything the Android SDK has to offer for Android developers. You can find it at http://developer.android.com/guide/components/index.html.
WebGL
WebGL support is one of the latest additions to the Libgdx framework. This backend uses the GWT to translate Java code into JavaScript and SoundManager2 (SM2), among others, to add a combined support for HTML5, WebGL, and audio playback. Note that this backend requires a WebGL-capable web browser to run the application.
You might want to check out the official website of GWT: https://developers.google.com/web-toolkit/.
You might want to check out the official website of SM2: http://www.schillmania.com/projects/soundmanager2/.
You might want to check out the official website of WebGL: http://www.khronos.org/webgl/.
There is also a list of unresolved issues you might want to check out at https://github.com/libgdx/libgdx/blob/master/backends/gdx-backends-gwt/issues.txt.