Tetra is a simple 2D game framework written in Rust. It uses SDL2 for event handling and OpenGL 3.2+ for rendering.
- API Docs
Tetra is not currently under active development (as of January 2022).
I will still be fixing minor bugs/updating dependencies where needed, but I don't plan on implementing any new features going forward.
PRs are welcome, but please open an issue/discussion if you're thinking of making a large change, so I can tell you if it's likely to be accepted or not!
For more information, see this blog post.
- XNA/MonoGame-inspired API
- Efficient 2D rendering, with draw call batching by default
- Easy input handling, via polling or events, with support for gamepads
- Deterministic game loop by default, à la Fix Your Timestep
- Common building blocks built-in, such as:
- Font rendering
- Screen scaling
To add Tetra to your project, add the following line to your
You will also need to install the SDL2 native libraries - full details are provided in the documentation.
To get a simple window displayed on screen, the following code can be used:
You can see this example in action by running
cargo run --example hello_world.
The full list of examples is available here.
Tetra is fairly early in development, so you might run into bugs/flaky docs/general weirdness. Please feel free to open an issue/PR if you find something! You can also contact me via Twitter or the Rust Game Development Discord.