Homebrew SwitchGDX: A LibGDX Switch Backend

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
38
Trophies
0
Age
23
XP
483
Country
United States
This is a Nintendo Switch homebrew and Xbox/UWP backend for the cross-platform Java game framework, LibGDX. This is accomplished using a Java to C++ transpiler. It uses a custom, stripped down Java runtime library that provides the APIs needed by the framework and the accompanying native code to provide features like file system access. LibGDX provides platform agnostic APIs for OpenGL based graphics, audio, networking, and input, which are mapped by this backend to the Switch using SDL and LibNX.

Features
  • Full LibGDX library
  • Music and sound effects
  • Controller input
  • OpenGL GLES20 based graphics
  • Java 7 support plus Java 8 features
  • One click NXLink deployment with standard out redirection
  • Desktop application builds for debugging
  • Xbox/UWP targets
  • File I/O
  • Box2D
  • FreeType

Links
Source code and documentation
: https://github.com/TheLogicMaster/switch-gdx
Java to C++ transpiler: https://github.com/TheLogicMaster/clearwing-vm
LibGDX compatibility: https://github.com/TheLogicMaster/switch-gdx/blob/master/TESTS.md

Screenshots
ShatteredPixel.png

Screenshot_20220527_005111.png
PixelWheels_screenshot_gameplay.png

yellow1.png
 
Last edited by TheLogicMaster,

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
38
Trophies
0
Age
23
XP
483
Country
United States
I wonder if we can have vulkan api backend by using this method.
This backend contains a Java wrapper around the GLAD based GLES20 bindings since that's what LibGDX requires, but making a similar wrapper for deko3d, for instance, would be pretty straightforward. Probably wouldn't be very useful without bindings for the rest of LibNX, though. This project is primarily based around the abstraction layer that LibGDX uses for making cross platform games, but the Java to C transpiler it's based on is portable and could be used to make a generic Java homebrew framework.
 

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
38
Trophies
0
Age
23
XP
483
Country
United States
Will those nokia NGage java games work too like Space Impact?
More power LM
Those seem to be based off of J2ME, so making something similar to J2ME-Loader should be possible, but definitely out of the scope of this project. This project mainly converts Java bytecode to C then provides enough of the standard runtime library for games to run, with bindings for things like OpenGL and SDL input. Most of the work takes place at compile time, so each game would have to be transpiled beforehand, rather than the typical homebrew scheme of just popping them onto the SD card. The main challenge would likely be in supporting the J2ME runtime, to provide support for all of the graphics and other I/O that the games require.
 

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
38
Trophies
0
Age
23
XP
483
Country
United States
Thank you so much for the port!..

Btw, is there any way to use the stick (Left Stick) to move the character? Would very appreciate it!
Yep, that can definitely be added. The LibGDX core library only has support for controller buttons, so it's just a matter of adding the controllers library then adding a tiny bit of code to map joystick inputs to digital values.
 
  • Like
Reactions: mathew77

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • light27 @ light27:
    fun fact
  • light27 @ light27:
    the first time i ever played on a wii u EVER was when I was getting my ear tubes removed
  • light27 @ light27:
    i was playing wii party
  • light27 @ light27:
    u*
  • light27 @ light27:
    but i only got to play for like
  • light27 @ light27:
    3 seconds
  • light27 @ light27:
    younger me would've never thought that I would have a wii u now
  • Xdqwerty @ Xdqwerty:
    @light27, i wanted a Wii u as a kid when i watched a Mario kart 8 commercial on tv
  • Psionic Roshambo @ Psionic Roshambo:
    I had a Wii-U it sucked lol
  • Psionic Roshambo @ Psionic Roshambo:
    Even hacked it sucked lol
  • The Real Jdbye @ The Real Jdbye:
    nah the Wii U wasn't bad
    +1
  • The Real Jdbye @ The Real Jdbye:
    the hardware is good
  • Psionic Roshambo @ Psionic Roshambo:
    The controller sucked
  • The Real Jdbye @ The Real Jdbye:
    it has good games, just not enough of them
    +2
  • ColdBlitz @ ColdBlitz:
    the indie games on wii u were amazing though
  • ColdBlitz @ ColdBlitz:
    and also some of nintendo's first party games
  • ColdBlitz @ ColdBlitz:
    some of the best selling games on the switch are wii u ports (that are priced way too high
    like come on 60 for a game thats a decade old??)
    +1
  • Xdqwerty @ Xdqwerty:
    @ColdBlitz, i forgot breath of the wild released for the Wii u
  • The Real Jdbye @ The Real Jdbye:
    $60 for a game that's a decade old might be unheard of on PC but actually is not uncommon on consoles
    +1
  • The Real Jdbye @ The Real Jdbye:
    especially Nintendo because they only ever lower the price of games when they do a greatest hits/platinum hits/players choice re-release
  • Xdqwerty @ Xdqwerty:
    @The Real Jdbye, and the HD collections released for 7th gen consoles too
  • The Real Jdbye @ The Real Jdbye:
    but they don't seem to have done any of those for the switch yet and maybe never will
  • ColdBlitz @ ColdBlitz:
    I think we all forgot breath of the wild released for the wii u tbh
    +1
  • Xdqwerty @ Xdqwerty:
    @The Real Jdbye, tbh the HD collections are more justified since they include more than just 1 game per copy
    Xdqwerty @ Xdqwerty: @The Real Jdbye, tbh the HD collections are more justified since they include more than just 1...