Skip to content

Install

The pfx tool runs on Linux with a Vulkan GPU. Install it with Rust 1.97 or newer (on Debian or Ubuntu, first sudo apt install libasound2-dev libudev-dev libxkbcommon-dev libwayland-dev libx11-dev):

cargo install --locked --git https://github.com/gmrdad82/pfx --tag v1.0.0 pfx

Then make a game, play it and open it in the editor:

git init my-game
pfx new my-game
cd my-game
cargo run --release
cargo run --release -- edit

A terminal: pfx –version prints pfx 0.32.0; git init and pfx new demo scaffold a game of 18 files; ls shows Cargo.toml, content, project.toml and src, and content holds first.scene.toml; pfx bench plays the first scene headless for 3 seconds at 1920x1080 and prints 180 frames and the GPU frame times.

The game is a type that implements pfx_game::Game; main hands it to the launcher, which runs the window, pacing, input, sound and a fixed tick:

use pfx_game::{Config, Game, Input, Tick, World};
struct MyGame;
impl Game for MyGame {
fn start(&mut self, _world: &mut World) {}
fn tick(&mut self, _world: &mut World, _tick: &Tick, _input: &Input) {}
}
fn main() -> std::process::ExitCode {
let config = Config::new("my-game", env!("CARGO_PKG_VERSION"), "content/first.scene.toml");
pfx_game::launch(|| MyGame, config, |_commands| {})
}

Games built on pfx build and pass their tests on Linux and Windows in CI, build for macOS on Apple Silicon in CI, and run on the Steam Deck through Proton (Windows). A game links the crates it uses by the same tag:

pfx-game = { git = "https://github.com/gmrdad82/pfx", tag = "v1.0.0" }
cargo build --release
bin/gate

bin/gate is what CI runs, one phase per job in parallel: lint (formatting, clippy with warnings as errors, the check that keeps game content out of the engine and the licence check of every dependency), tests (the binaries, examples, unit, integration and doc tests), release (the optimised pfx binary), windows (the game crates’ clippy and tests on Windows) and macos (the game crates on macOS). With no phase it runs lint and tests. CI also runs nightly on main. The GPU tests are #[ignore]d and need a GPU: run a crate’s with cargo test -p <crate> -- --ignored.