Homebrew SwitchGDX: A LibGDX Switch Backend

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
27
Trophies
0
Age
21
XP
252
Country
United States
This is a Nintendo Switch homebrew backend for the cross-platform Java game framework, LibGDX. This is accomplished using a custom fork of the CodenameOne Parpar VM 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. It's still a work in progress, but a majority of LibGDX features are working.

Features
  • Full LibGDX library
  • Music and sound effects
  • Controller input
  • OpenGL GLES20 based graphics
  • Java 7 support plus Java 8 features with RetroLambda
  • One click NXLink deployment with standard out redirection
  • Desktop application builds for debugging
  • 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
Screenshot_20220527_005111.png
 
Last edited by TheLogicMaster,

TheLogicMaster

Active Member
OP
Newcomer
Joined
Dec 28, 2021
Messages
27
Trophies
0
Age
21
XP
252
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
27
Trophies
0
Age
21
XP
252
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
27
Trophies
0
Age
21
XP
252
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
General chit-chat
Help Users
  • No one is chatting at the moment.
    NeoGaming @ NeoGaming: i'm back