This program draws "Hello world!" on the Nintendo Switch using a bitmap font.
The main code is in hello.c.
To see another simple SDL2 program with graphics and input, see spacenx, or for a more complicated one appstorenx
-
You will need llvm for your computer. You can probably get this through your package manger (eg.
brew install llvm
, see here for more info) -
Setup and install libtransistor by downloading it from the releases page. It is recommended to copy it to
/opt/libtransistor
. -
Export the following environment variable to where you unpacked libtransistor. You may want to put this line in your bash profile:
export LIBTRANSISTOR_HOME=/opt/libtransistor
- Clone, setup, and compile sdl-libtransistor:
git clone https://github.com/reswitched/sdl-libtransistor.git
cd sdl-libtransistor
make -f switch.mk
- Install pyelftools and lz4via pip
pip3 install pyelftools lz4
- Clone this repo and run make:
git clone https://github.com/vgmoose/sdl-hello-world.git
cd sdl-hello-world
make
A file hello.nro
should be sitting in your current directory.
-
Setup and install dkp-pacman
-
Install devkitA64 needed Switch dependencies via dkp-pacman:
sudo dkp-pacman -S devkitA64 libnx switch-tools switch-sdl2
- Clone this repo and run make:
git clone https://github.com/vgmoose/sdl-hello-world.git
cd sdl-hello-world
make -f Makefile.libnx
A file hello.nro
should be sitting in the build
folder.
This program can also be compiled for the computer. There's no Makefile target, but with SDL2 installed:
gcc -lSDL2 *.c -o hello
./hello
You can run this program on most Switches that were released prior to June 2018 regardless of firmware. For detailed instructions, see this post.
You should put the hello.nro
file in sd:/switch/hello.nro
and then run hbmenu in order to run this app.
If you need additional resources or help, you can feel free to stop by the Homebrew App Store discord server, make an issue on this repo, or contact me directly.