Quick start · Frame API · Tests
use realm_render::{Error, render_to_png};
fn main() -> Result<(), Error> {
render_to_png(320, 180, |frame| {
frame.clear([0.08, 0.18, 0.16, 1.0]);
frame.circle([160.0, 90.0], 18.0, [0.95, 0.65, 0.22, 1.0]);
frame.hud().text([8.0, 8.0], 2.0, [1.0; 4], "Spawn");
}, "spawn.png")
}Realm Render is a standalone Rust library for drawing 2D games with wgpu and winit. It batches shapes, sprites, and bitmap text into world and HUD layers, collects keyboard and mouse input, and can render a frame directly to a PNG.
|
Set a |
|
|
|
Read keyboard edges, typed text and mouse clicks in |
|
Pass a drawing closure and a path to |
|
|
Geometry
|
Sprites
|
Text
|
|
Camera
|
Input
|
Output
|
wgpu and WGSL draw the frame. winit supplies window events, glam supplies vectors and font8x8 supplies the bitmap glyphs.
With Rust 1.99 or newer and Cargo, add the crate to an existing Rust project.
cargo add --git https://github.com/mpge/realm-render realm-renderUse a machine with a compatible wgpu adapter. Put the example in src/main.rs and run cargo run to write spawn.png in the working directory. The windowed example draws through Game2d.
| Topic | Reference |
|---|---|
| Drawing | Textures · Camera · WGSL shader |
| Output | Window runner · Offscreen pixel tests |
MIT License, copyright © 2026 Matthew Gros.
Realm is an independent project and is not affiliated with or endorsed by Laravel Holdings Inc.
