Console support for libGDX is a hotly debated topic. This page tries to give a broad overview of how you might go about getting your game to work on your favourite consoles, including Xbox, PlayStation and Nintendo Switch.
The General Idea
To get your libGDX game running on consoles, you need to port your code base to a different language. While (in theory) this can be done manually, a considerably less time-consuming (but technologically complex) way of porting your game is to compile/transpile it to code that can run on your targeted platform. Inspiration can be drawn from libGDX’s Web (see GWT) and iOS (see RoboVM) backends, which already do this.
In addition, you need a custom libGDX backend with bindings for the device in question.
There are a couple of games, which have successfully done this in the past:
- Slay the Spire, which was ported by Sickhead Games first to C# and then to C++
- Pathway, which uses a custom fork of RoboVM and a SDL backend
- Orangepixel’s games (check out his devlogs for more information)
Different Approaches & Other Resources
- TheLogicMaster has a working PoC of a Nintendo Switch homebrew backend over at SwitchGDX, which uses a custom fork of CodenameOne’s ParparVM
- IKVM (which was used by libGDX in the past) could prove as another viable option; see here for IKVM’s current main fork
- Anuken’s Ark has a SDL backend here; SDL has a working port for Nintendo Switch
- A similar goal is being pursued by the mini2Dx project.