โ† All Workshops

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.

Terminal 1: Start the server
dx serve
Terminal 2: Launch native client
cargo run
๐Ÿงช What to check
  1. Terminal 1 โ€” dx serve compiles and starts the Axum server on port 8080
  2. Terminal 2 โ€” cargo run compiles the native binary and opens a window
  3. The native window shows the name screen โ€” enter a name and click "Enter the World"
  4. The grid renders โ€” CSS Grid layout via Taffy
  5. Room names appear in each cell โ€” text rendering via Parley + Vello
  6. Click D-pad buttons โ€” the WebSocket fires, the grid updates, the description panel changes
  7. Open http://localhost:8080 in a browser โ€” join with a different name
  8. 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
๐Ÿšฆ Troubleshooting

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.