Commit graph

10 commits

Author SHA1 Message Date
Simon Hausmann
0002df2520
slint crate: Expose parts of the winit backend's previously private API (#8315)
Similar to the wgpu access, the `unstable-winit-030` feature exposes a
`slint::winit_030` module, which in turn re-exports `winit` but also
provides access to the `WinitWindowAccessor` trait. The
`BackendSelector` is extended to provide a way to hook into window
attribute creation as well as providing a custom event loop builder,
similar to what `i_slint_backend_winit::BackendBuilder` provides.
2025-05-02 09:21:13 +02:00
Simon Hausmann
2f2478d1ea WGPU: Clean up public API
- Create a `slint::wgpu_24` module
- Re-export `wgpu` in it
- Place the WGPU config types used by the `BackendSelector::require_wgpu_24` function in it, and remove the 24 infix.

As an upside, this also adds the feature guard to the docs at least for the `wgpu_24` module.
2025-04-30 15:54:06 +02:00
Simon Hausmann
33581182ef backend-selector: Add the ability to configure WGPU
The `require_wgpu_24` function accepts either a fully setup WGPU, or one
can configure individual aspects such as features/limits.

The wgpu_texture example uses this to add push constants to the required
features and thus eliminates the need for uniform buffers.
2025-04-29 17:46:57 +02:00
Simon Hausmann
da5e7d5b22 WGPU: Add support for using WGPU textures in Slint
This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.

The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-29 17:46:57 +02:00
Yuri Astrakhan
5356fdcf89 Fix clippy issues, plus a few manual cleanups
* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Simon Hausmann
1c5c9db181 From the BackendSelector API, link to the backends and renderer chapter in the docs 2024-12-18 09:34:03 +01:00
Simon Hausmann
10413c555e doc: remove BackendSelector::doc_internal from public API 2024-12-17 10:11:58 +01:00
Simon Hausmann
9ff1d88602 Implement Drop for BackendSelector to select the backend 2024-12-16 13:06:05 +01:00
Simon Hausmann
0d36f88152 Revamp BackendSelector API
Based on API review, PlatformBuilder becomes BackendSelector with
a slightly smaller API surface but more options, such as selecting
Metal or Vulkan rendering.
2024-12-16 13:06:05 +01:00