Hybrid Switch/PC Example Application using GLFW
This is an example OpenGL project using GLFW and GLM that builds and runs on both Switch and PC.
resources
folder, or from RomFS on SwitchTo build for Switch, a standard development environment must first be set up. In order to do so, refer to the Getting Started guide.
(sudo) (dkp-)pacman -S switch-glfw switch-mesa switch-glm
make -j
nxlink -s hybrid_app.nro
To build for PC, the following components are required:
Please refer to the usual sources of information for your particular operating system. Usually the commands needed to build this project will look like this:
meson build
ninja -C build
./build/hybrid_app
Also, please note that the resources
folder must be available in the working directory, otherwise the program will fail to find the shaders.
msys2 provides all packages needed to build this project:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-meson mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-glfw mingw-w64-x86_64-glm
LDFLAGS="-static" meson build
ninja -C build
./build/hybrid_app