in Engine

libGDX 1.11.0

From libGDX: link to original post

If you are looking for past changelogs, check out this page.

Since our last release a little over a year ago, a great deal of work has been done! libGDX 1.11.0 brings improvements and new features in various areas – take a look below to find out more! If you are upgrading from an older version, be sure to also check out the Ultimate Migration Guide (1.9.10 to 1.10.0).

LWJGL 3!

As announced in Status Report #7, the LWJGL 3 backend is now the default desktop backend. This ensures continued support for newer hardware and JVMs and includes a few other nifty features. Check out the Status Report to see how to update your projects, if you haven’t already! We also updated from LWJGL 3.2.3 to 3.3.1, which adds the long awaited M1 Mac support!

Another cool new feature is the gdx-lwjgl3-glfw-awt-macos extension. If you add it as a dependency to your desktop project, LWJGL 3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. can be used. Moreover, you no longer need to pass the -XstartOnFirstThread argument when starting a LWJGL 3 app on macOS. See AwtTestLWJGL in gdx-tests-lwjgl3 for an example. For more information, take a look at #6772.

In addition, legacy LWJGL 3 projects must update their sourceCompatibility to 1.8 or higher! Otherwise an error similar to the one below will appear:

Execution failed for task ':desktop:compileJava'.
> Could not resolve all files for configuration ':desktop:compileClasspath'.
   > Could not resolve com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0.
     Required by:
         project :desktop
      > No matching variant of com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0 was found. The consumer was configured to find an API of a library compatible with Java 7, preferably in the form of class files, and its dependencies declared externally but:
          - Variant 'apiElements' capability com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0 declares an API of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 8 and the consumer needed a component compatible with Java 7
      [...]

Furthermore:

  • Please note that Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation.
  • LWJGL3Net#openURI does now work on macOS & JDK >= 16; we also added a fallback to xdg-open on Linux if Desktop.BROWSE is unavailable
  • Issues with LWJGL 3 and borderless fullscreen were resolved
  • The AL_DIRECT_CHANNELS_SOFT option is now enabled by default for Sounds and AudioDevices as well; see #6527

LWJGL 3 ANGLE Extension

Mario also recently added a LWJGL3 ANGLE extension. It emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS) and may become the preferred method of rendering on macOS if Apple removes OpenGL support entirely.

To use it, add the gdx-lwjgl3-angle extension to your gdx-lwjgl3 desktop project. Then call config.setOpenGLEmulation(GLEmulation.ANGLE_GLES20, 0, 0) on your Lwjgl3ApplicationConfiguration instance before creating your Lwjgl3Application. Check out #6672 for more information.

Pros:

  • Better compatibility with systems that don’t support OpenGL 2 by using DirectX on Windows and Metal on macOS.
  • May fix some OpenGL driver issues.

Cons:

  • Does only support OpenGL ES 2.0, as the macOS ANGLE Metal backend only supports OpenGL ES 2.0 at this point in time.
  • Currently contains non-working 32-bit Windows natives (see #6806).
  • Doesn’t support window transparency on macOS/Linux.

A few notable changes

  • Updated to MobiVM 2.3.16 from 2.3.12. This adds iOS 15.4 bindings, native M1 support as well as other fixes and improvements, including Gradle 7 support.
  • The GWT reflection cache was split into two generated classes, which doubles its size! (#6386)
  • An octree structure was added; see #6229
  • Added NWSEResize, NESWResize, AllResize, NotAllowed and None system cursors; see #6756 & #6822; and Graphics#setSystemCursor() now works on Android as well

Other breaking changes

  • We increased the minimum supported iOS version to 9.0. Update your Info.plist file if necessary.
  • On Android, we moved the natives loading out of static init block (see #5795); this allows users to run code before the initialisation of the natives
  • Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04) to match the behaviour of LWJGL 3; this may make older Linux operating systems no longer compatible (see #6659)
  • The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png. The new files should match the old ones very closely, but there is the possibility that it may change some text layout that uses the built-in font. Code that expects arial-15 assets to be present must change to lsans-15! (#6727)
  • AndroidApplicationConfiguration#hideStatusBar was removed; see #6683

Full changelog

Updating your Gradle project is straight-forward: Check out the instructions on the wiki! The latest version of dependencies can, as always, be found here.

- [BREAKING CHANGE] iOS: Increased min supported iOS version to 9.0. Update your Info.plist file if necessary.
- [BREAKING CHANGE] Android Moved natives loading out of static init block, see #5795
- [BREAKING CHANGE] Linux: Shared libraries are now built on Ubuntu 18.04 (up from Ubuntu 16.04)
- [BREAKING CHANGE] The built-in font files arial-15.fnt and arial-15.png have been replaced with lsans-15.fnt and lsans-15.png; this may change some text layout that uses the built-in font, and code that expects arial-15 assets to be present must change to lsans-15.
- [BREAKING CHANGE] Legacy LWJGL3 projects must update the sourceCompatibility to 1.8 or higher.
- [BREAKING CHANGE] Android Removed hideStatusBar configuration, see #6683
- [BREAKING CHANGE] Lwjgl3ApplicationConfiguration#useOpenGL3 was replaced by #setOpenGLEmulation
- [CONTRIBUTING] Removed Maven and Ant build systems. libGDX is now solely built with Gradle. See https://libgdx.com/dev/from-source/ for updated build instructions.
- [CONTRIBUTING] Gradle build now takes -PjavaVersion=7|8|9... to specify the Java version against which to compile libGDX. Default is Java 7 for everything, except the LWJGL3 backend, which is compiled for Java 8.
- LWJGL3 extension: Added gdx-lwjgl3-glfw-awt-macos extension. Fixes GLFW in such a way, that the LWJGL3/libGDX must no longer run on the main thread in macOS, which allows AWT to work in parallel, i.e. file dialogs, JFrames, ImageIO, etc. You no longer need to pass `-XstartOnFirstThread` when starting an LWJGL3 app on macOS. See `AwtTestLWJGL` in gdx-tests-lwjgl3. For more information, see https://github.com/libgdx/libgdx/pull/6772
- API Addition: Added LWJGL3 ANGLE support for x86_64 Windows, Linux, and macOS. Emulates OpenGL ES 2.0 through DirectX (Windows), desktop OpenGL (Linux), and Metal (macOS). May become the preferred method of rendering on macOS if Apple removes OpenGL support entirely. May fix some OpenGL driver issues. More information here: https://github.com/libgdx/libgdx/pull/6672
- iOS: Update to MobiVM 2.3.16
- Update to LWJGL 3.3.1; adds support for M1 Macs
- API Addition: ObjLoader now supports ambientColor, ambientTexture, transparencyTexture, specularTexture and shininessTexture
- API Addition: PointSpriteParticleBatch blending is now configurable.
- TOOLS Features: Blending mode and sort mode can be changed in Flame particle 3D editor.
- API Addition: Polygon methods setVertex, getVertex, getVertexCount, getCentroid.
- API Addition: TMX built-in tile property "type" is now supported.
- API Addition: Octree structure.
- API Addition: Added StringBuilder#toStringAndClear() method.
- FirstPersonCameraController keys mapping is now configurable
- Fix: GlyphLayout: Several fixes for color markup runs with multi-line or wrapping texts
- API change: GlyphLayout#GlyphRun is now one GlyphRun per line. "color" was removed from GlyphRun and is now handled by GlyphLayout.
- Gdx Setup Tool: Target Android API 30 and update AGP plugin to 4.1.3
- API Fix: Sound IDs are now properly removed; this prevents changes to music instances with the same ID
- API Fix: LWJGL3Net#openURI does now work on macOS & JDK >= 16
- API Fix: Fixed a possible deadlock with AssetManager#dispose() and #clear()
- API Change: Enable the AL_DIRECT_CHANNELS_SOFT option for Sounds and AudioDevices as well to fix stereo sound
- API Addition: CameraInputController#setInvertedControls(boolean)
- API Removal: AnimatedTiledMapTile#frameCount
- LWJGL 3 is now the default desktop backend. If you want to port your existing applications, take a look here: https://gist.github.com/crykn/eb37cb4f7a03d006b3a0ecad27292a2d
- Brought the official and third-party extensions in gdx-setup up to date. Removed some unmaintained ones and added gdx-websockets & jbump.
- API Fix: Escaped characters in XML attributes are now properly un-escaped
- Bug Fix: AssetManager backslash conversion removed - fixes use of filenames containing backslashes
- gdx-setup now places the assets directory in project root instead of android or core. See advanced settings (UI) or arguments (command line) if you don't want it in root.
- API Fix: Resolved issues with LWJGL 3 and borderless fullscreen
- API Addition: GeometryUtils,polygons isCCW, ensureClockwise, reverseVertices
- API Addition: Added FreeTypeFontGenerator#hasCharGlyph method.
- API Fix: Pool discard method now resets object by default. This fixes the known issue about Pool in libGDX 1.10.0.
- API Addition: Split GWT reflection cache into two generated classes
- API Fix: Fix Box2D memory leak with ropes on GWT
- API Fix: Fix NPE in Type#getDeclaredAnnotation
- API Addition: Add pause/resume methods to AudioDevice
- API Fix: Protection against NullPointerException in World#destroyBody()
- API Fix: Prevent repeated mipmap generation in FileTextureArrayData
- API Fix: Fix issue with camera reference in CameraGroupStrategy’s default sorter
- API Fix: Move vertex array index buffer limit to backends to fix issue with numIndices parameter
- API Fix: TexturePacker: Fix wrong Y value when using padding
- API Fix: Lwjgl3Net: Add fallback to xdg-open on Linux if Desktop.BROWSE is unavailable
- API Addition: Add NWSEResize, NESWResize, AllResize, and NotAllowed and None SystemCursors
- API Addition: GWTApplication#getJavaHeap and getNativeHeap are now supported
- API Addition: Box2D Shape now implements Disposable
- API Addition: Added ChainShape#clear method
- API Addition: Adds Tooltip#setTouchIndependent; see #6758
- API Addition: Emulate Timer#isEmpty on GWT
- API Addition: Bits add copy constructor public Bits (Bits bitsToCpy)
- API Addition: Added List#drawSelection().
- API Addition: GwtApplicationConfiguration#xrCompatible
- API Fix: setSystemCursor() now works on Android
- API Fix: getDisplayMode() is now more accurate on Android and GWT.
- API Addition: JsonValue#iterator(String) to more easily iterate a child that may not exist.
- API Addition: Added ExtendViewport#setScaling, eg for use with Scaling.contain.
- API Addition: Added getBoundingRectangle() to Polyline
- API Addition: ShapeRenderer#check() has now protected visibility
- API Addition: Add ability to host GWT module on a different domain than the site, see #6851
- Various minor Scene2D improvements