MudEngine Part 10: Desktop with Blitz
Run it!
You need two terminals for this part. One runs the server, the other runs the native client.
dx servecargo run- Terminal 1 โ
dx servecompiles and starts the Axum server on port 8080 - Terminal 2 โ
cargo runcompiles the native binary and opens a window - The native window shows the name screen โ enter a name and click "Enter the World"
- The grid renders โ CSS Grid layout via Taffy
- Room names appear in each cell โ text rendering via Parley + Vello
- Click D-pad buttons โ the WebSocket fires, the grid updates, the description panel changes
- Open
http://localhost:8080in a browser โ join with a different name - Both clients see each other โ the WebSocket broadcast works across native + browser
Test the rendering
Compare the look between the browser and the native window:
- Grid โ should look similar; CSS Grid is well-supported
- Text โ the browser uses system fonts; Blitz uses Parley for text layout
- Colours โ basic colours match; gradients may not
- Buttons โ clickable areas work; hover effects may not
- Scroll โ overflow content scrolls via winit events
cargo run fails โ "use of undeclared crate or module dioxus_native"
โ Make sure dioxus-native = "0.7" is in your Cargo.toml. Run cargo update after adding it.
Window opens but is blank
โ Check the terminal for panics. The most common cause: the WebSocket can't connect because the server isn't running. Start dx serve in a separate terminal first.
"Cannot find function set_server_url"
โ Import it explicitly: use dioxus::fullstack::set_server_url;. It's not in the dioxus_native prelude.
"No such file or directory: assets/main.css"
โ Blitz respects the same asset resolution as the web build. Make sure assets/main.css exists in your project root.
"The rsx! macro is not export controlled by dioxus_native"
โ Ensure you are using use dioxus_native::prelude::*; โ this re-exports the rsx! macro from dioxus-core-macro.
WGPU errors on startup (Vulkan not found) โ Blitz requires a GPU with Vulkan (Linux/Windows), Metal (macOS), or DX12 (Windows) support. On some headless systems or VMs, you may need to install GPU drivers or use software rendering fallbacks.
Slow compilation
โ The first build after adding dioxus-native compiles all of Blitz's dependencies (stylo, taffy, vello, wgpu, etc.). This can take several minutes. Subsequent builds are incremental and faster.
Blitz panic: "not yet implemented" โ You've hit a missing CSS feature. Try removing the CSS property that caused it, or simplify the stylesheet to basic colours and layout. Check the terminal for the panic location.