- Introduction
- Made with cross2d
- Build for Linux
- Build for Nintendo Switch
- Build for Nintendo 3DS
- Build for Sony Ps Vita
- Build for Sony PS4
- Add custom data to your project
- What to do next ?
- a c++ cross platform 2d graphic, input, audio and config library
- run on Windows, Linux, Nintendo Switch, Nintendo 3DS, Sony PS Vita, Sony PS4, Dreamcast
- draw textures, rectangles, circles, texts (TrueType) and more
- basic tween engine (move, rotate, scale, color)
- clock/timer classes
- configuration file handling
- pack your application (zip) for release on any target, including resources (data)
- quickly prototype your application on desktop (Linux and Windows)
- use hardware acceleration
- use some of the great sfml library stuff (fonts, shapes, matrices)
- use tweeny for the (minimal) tween engine
- use some of the great libretro shaders (Linux, Switch, PS4)
- preliminary developed for my own use, still a work in progress
- pfbneo: final burn neo emulator port
- psnes: snes9x emulator port
- pnes: nestopia emulator port
- pplay: mpv video player
- SillyTower: simple physics based game
- RetroDream: sega dreamcast iso loader
- Install dependencies
sudo apt -yq update sudo apt -yq install build-essential cmake git libsdl2-dev libfreetype6-dev libglm-dev libconfig-dev libzip-dev libfuse-dev
- Clone this template repository
git clone --recursive https://github.com/Cpasjuste/libcross2d-template.git
- Build !
cd libcross2d-template mkdir cmake-build-release && cd cmake-build-release cmake -G "Unix Makefiles" -DPLATFORM_LINUX=ON -DCMAKE_BUILD_TYPE=Release ../ make -j4
- Install dependencies
sudo apt -yq update sudo apt -yq install build-essential cmake git zip curl
- Install switch toolchain (devkitpro)
wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb sudo dpkg -i devkitpro-pacman.amd64.deb sudo dkp-pacman -Syu sudo dkp-pacman --noconfirm -S switch-dev switch-portlibs
- Clone this template repository
git clone --recursive https://github.com/Cpasjuste/libcross2d-template.git
- Build !
cd libcross2d-template mkdir cmake-build-release && cd cmake-build-release export DEVKITPRO=/opt/devkitpro cmake -G "Unix Makefiles" -DPLATFORM_SWITCH=ON -DCMAKE_BUILD_TYPE=Release ../ make -j4 app.nro
- Install dependencies
sudo apt -yq update sudo apt -yq install build-essential cmake git zip curl
- Install 3ds toolchain (devkitpro)
wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb sudo dpkg -i devkitpro-pacman.amd64.deb sudo dkp-pacman -Syu sudo dkp-pacman --noconfirm -S 3ds-dev 3ds-portlibs
- Clone this template repository
git clone --recursive https://github.com/Cpasjuste/libcross2d-template.git
- Build !
cd libcross2d-template mkdir cmake-build-release && cd cmake-build-release export DEVKITPRO=/opt/devkitpro cmake -G "Unix Makefiles" -DPLATFORM_3DS=ON -DCMAKE_BUILD_TYPE=Release ../ make -j4 app.3dsx
- Install dependencies
sudo apt -yq update sudo apt -yq install build-essential cmake git zip curl python
- Install ps vita toolchain (vitasdk)
git clone https://github.com/vitasdk/vdpm cd vdpm ./bootstrap-vitasdk.sh export VITASDK=/usr/local/vitasdk export PATH=$VITASDK/bin:$PATH ./install-all.sh
- Clone this template repository
git clone --recursive https://github.com/Cpasjuste/libcross2d-template.git
- Build !
cd libcross2d-template mkdir cmake-build-release && cd cmake-build-release export VITASDK=/usr/local/vitasdk cmake -G "Unix Makefiles" -DPLATFORM_VITA=ON -DCMAKE_BUILD_TYPE=Release ../ make -j4 app.vpk
- Install dependencies
sudo apt -yq update sudo apt -yq install build-essential cmake git zip curl libgpgme11
- Install ps4 toolchain (openorbis via pacbrew)
wget https://github.com/PacBrew/pacbrew-pacman/releases/download/pacbrew-release-1.0/pacbrew-pacman-1.0.deb sudo dpkg -i pacbrew-pacman-1.0.deb sudo pacbrew-pacman -Syu sudo pacbrew-pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs
- Clone this template repository
git clone --recursive https://github.com/Cpasjuste/libcross2d-template.git
- Build !
cd libcross2d-template mkdir cmake-build-release && cd cmake-build-release export OPENORBIS=/opt/pacbrew/ps4/openorbis cmake -G "Unix Makefiles" -DPLATFORM_PS4=ON -DCMAKE_BUILD_TYPE=Release ../ make -j4 app_pkg
libcross2d should automatically handle your data. In the data folder of your project, you'll find multiple directories:
- 3ds: data in this directory will only be included in nintendo 3ds builds (platform)
- common: data in this directory will be included in all builds (platforms)
- dreamcast: data in this directory will only be included in sega dreamcast builds (platform)
- linux: data in this directory will only be included in linux builds (platform)
- ps4: data in this directory will only be included in sony ps4 builds (platform)
- switch: data in this directory will only be included in nintendo switch builds (platform)
- vita: data in this directory will only be included in sony ps vita builds (platform)
In each platform directory, you'll find two subdirectories:
- datadir: files in this directory will be available on the target platform storage (hard drive, micro-sd, etc...) (Io:: getDataPath)
- romfs: files in this directory will be embedded in the application binary (Io::getRomFsPath)
You can take a look at the libcross2d-examples repository for a few examples !