examples/bevy/bevy-hosts-slint-gpu/README.md
This example demonstrates how to integrate Slint UI into a Bevy application.
It shows how to render a Slint component with WGPU into a Bevy Image (texture) and display it on a 3D quad mesh attached to a rotating cube, complete with mouse interaction handling via raycasting.
slint::platform::Platform to bridge Slint's windowing to Bevy.cargo run --release
The integration consists of a few key parts:
SlintBevyPlatform: A custom implementation of slint::platform::Platform that manages window adapters.BevyWindowAdapter: Implements slint::platform::WindowAdapter. It doesn't create a native OS window but instead maintains a buffer for the software renderer.render_slint System: A Bevy system that runs every frame. It triggers the Slint renderer and updates the Bevy image with the new pixel data.handle_input System: Raycasts from the camera through the mouse position, checks for intersection with the UI quad, converts the 3D hit point to UV coordinates, then to Slint's logical coordinates, and dispatches pointer events to the Slint window.main.rs: Contains the entire example code, including the Slint UI definition (in the slint! macro), the Bevy systems, and the adapter logic.