← All Workshops

MudEngine Part 10: Desktop with Blitz

Step 5 / 12

Run the native client

The server/client split works differently with the Blitz renderer. Since dioxus-native builds a native binary (not WASM), dx serve --desktop doesn't apply here — that command uses the wry-based desktop renderer.

Instead, we run the server and client as separate binaries. The dx serve command compiles and starts the Axum server. The native client is a separate process that connects to it.

Terminal 1: Start the server

Start the Axum server
dx serve
🔄 What dx serve does here

The dx serve command compiles the server binary (with --features server) and the web client WASM bundle (the default). It starts the Axum server on port 8080.

The native client doesn't need to be compiled by dx — it's a separate cargo run invocation.

Terminal 2: Start the native client

In a second terminal, run the native client directly with cargo:

Launch native MUD client
cargo run
🎯 What happens
  1. cargo run compiles the project without the server feature
  2. The #[cfg(not(feature = "server"))] block runs set_server_url("http://localhost:8080")
  3. dioxus_native::launch(App) opens a winit window with the Blitz renderer
  4. The renderer loads your CSS from assets/main.css (via document::Stylesheet) — but through Blitz's own CSS parser, not a browser's
  5. The WebSocket connects to the server at localhost:8080
  6. The MUD UI renders — name screen, grid, sidebar, D-pad — all drawn by WGPU/Vello

Open http://localhost:8080 in a browser alongside the native window to see both clients sharing the same game world.

🪟 What the window looks like

The native window will have:

  • OS chrome — standard title bar, close/minimize/maximize buttons (provided by winit)
  • Dark background — the CSS gradient from assets/main.css rendered by Vello
  • No address bar — it's a native app, not a browser
  • GPU-accelerated rendering — the WGPU backend uses Vulkan (Linux/Windows), Metal (macOS), or DX12 (Windows)
⚠️ What might not work

Because Blitz is experimental, several CSS features used by the MUD may not render correctly:

  • linear-gradient backgrounds — may appear as a solid colour
  • box-shadow — may be missing or incorrect
  • transition / animation — not implemented yet
  • position: fixed — the floating player list may not stay pinned
  • filter: brightness() — may not work on hover
  • @keyframes — the quest pulse animation won't animate

The UI will still be functional — the grid, buttons, input, and chat will work. It may just look slightly different from the browser version.

This is the nature of an experimental renderer. Each week the Blitz team ships more CSS support.

Step 5 / 12