wilhelm_renderer is a minimalist 2D graphics engine written in Rust with native OpenGL bindings. Its goal is to provide a robust foundation for rendering 2D shapes and visualizing 2D data and animations in real time.
🚧 Status
⚠️ APIs are still evolving — always use the latest release.
✨ Features
Currently supported drawing primitives:
- Text rendering (using the FreeType library)
- Points and MultiPoints
- Lines (with thickness)
- Polylines
- Arcs
- Rectangles and Rounded Rectangles
- Triangles
- Circles and Ellipses
- Polygons
- Images
Other features:
- All dependencies, including GLFW and FreeType, are bundled
- Instanced rendering for high-performance scenes (10,000+ shapes)
- Basic animation support
- A simple Camera model for projecting between world and screen coordinates
📦 Example usage
All examples are provided in the wilhelm_renderer repository's examples directory.
You can build shapes and render them using the ShapeRenderable abstraction, as shown below:
extern crate wilhelm_renderer;
use ;
use ;
For a full example, see shapes.rs.

Additional examples:
-
bouncing_balls_instanced.rs– demonstrates instanced rendering with 10,000 animated balls (usecargo runinside theexamples/bouncing_ballsfolder)
🐞 Issues
You can report issues directly on GitHub.
🔧 Installation
Linux
Ensure you have the necessary build tools installed (including a C/C++ compiler and CMake):
sudo apt-get install libgl1-mesa-dev
sudo apt install mesa-utils
sudo apt install libwayland-dev libxkbcommon-dev xorg-dev
Add wilhelm_renderer as a dependency in your project. During the build process,
Cargo will invoke CMake to build a static library containing the wilhelm_renderer FFI bindings to OpenGL.
Windows
Ensure that Visual C++ Build Tools and CMake 3.5 or later are installed.
macOS
Ensure that the Xcode command-line tools and CMake 3.5 or later are installed.