Installation

September 20, 2025 ยท View on GitHub

To get started with Tetra, you'll need several things installed, some of which are only needed on certain platforms:

  • All platforms:
    • The latest stable version of Rust
    • The SDL development libraries
  • Linux:
    • The ALSA development libraries

Installing Rust

Installing Rust is pretty simple - just go to the website and download the Rustup toolchain manager.

Note that if you're developing on Windows with the default toolchain, you'll also need to install the Microsoft Visual C++ Build Tools. This is used for linking your code together.

Installing SDL

Tetra uses a library called SDL for windowing and input, so you will need to have its runtime and development libraries installed in order for your project to compile.

Alternatively, you can have SDL automatically compile from source as part of the build process - see Do I have to install SDL manually? for more details.

Windows

  1. Go to SDL's GitHub releases page and download the version of the development libraries that corresponds to your Rust toolchain.
    • If you're using the MSVC toolchain, download SDL3-devel-3.xx.x-VC.zip.
    • If you're using the GNU toolchain, download SDL3-devel-2.xx.x-mingw.zip.
  2. Inside the .zip file, open the SDL3-3.xx.x/lib/x64 folder and extract SDL3.lib and SDL3.dll to the root of your Cargo workspace.

You will also need to distribute SDL3.dll with your game - see the distributing guide for more details.

Mac

The easiest way to install SDL is via Homebrew:

brew install sdl3

You will also need to add the following to your ~/.bash_profile, if it is not already present.

export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib:/usr/local/lib"

Linux

The SDL development libraries are usually acquired through your Linux distribution's package manager. Unfortunately, as SDL 3 is relatively new, not every distribution has an up-to-date package yet. If you can't find one for your distro of choice, you can configure Tetra to build SDL from source instead.

Installing ALSA (Linux only)

On Linux, ALSA is used as the audio backend, so you will also need the ALSA development libraries installed. You can find these on most Linux package managers:

# Ubuntu/Debian
sudo apt install libasound2-dev

# Fedora/CentOS
sudo yum install alsa-lib-devel

# Arch Linux
sudo pacman -S alsa-lib