kui-wgpu
wgpu renderer for kui: draws a kui_core::DisplayList with one instanced pipeline, a single draw call per frame.
kui splits a UI into a model that lays out and paints into a display list (kui-core), a renderer that puts that list on screen (this crate) and a runner that owns the window and the event loop (kui-native, the one most apps use). Reach for kui-wgpu directly when you are writing your own runner: you already have a window, or an event loop, that kui-native does not fit. A Renderer owns one window's swapchain and a GPU copy of the core's glyph atlas; several windows share one device through Gpu.
Install
wgpu is re-exported as kui_wgpu::wgpu, so you build against the version this crate was.
Example
Open a renderer on a window, then build, draw and present one frame at a time. window is anything wgpu can make a surface from, such as a winit window.
use ;
use ;
Where it fits
| Crate | What it is |
|---|---|
| kui-core | The model: tree, layout, text, display list |
| kui-wgpu | This crate: the renderer |
| kui-native | The windowed runner most apps use |
| kui-derive | #[derive(Message)] |
| kui-lua, kui-ffi | Lua and C bindings |
Documentation
- API reference: https://docs.rs/kui-wgpu
- The book: https://kui-book.qxuken.dev
- Repository: https://github.com/qxuken/kui
License
MIT