Fix broken doc links in iced_wgpu and iced_graphics
This commit is contained in:
parent
d461f23e8d
commit
cc05cb9be4
3 changed files with 14 additions and 13 deletions
|
|
@ -35,6 +35,8 @@ pub enum Image {
|
||||||
|
|
||||||
#[cfg(feature = "image")]
|
#[cfg(feature = "image")]
|
||||||
/// Tries to load an image by its [`Handle`].
|
/// Tries to load an image by its [`Handle`].
|
||||||
|
///
|
||||||
|
/// [`Handle`]: image::Handle
|
||||||
pub fn load(
|
pub fn load(
|
||||||
handle: &image::Handle,
|
handle: &image::Handle,
|
||||||
) -> ::image::ImageResult<::image::DynamicImage> {
|
) -> ::image::ImageResult<::image::DynamicImage> {
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,18 @@
|
||||||
use crate::core::{Font, Pixels};
|
use crate::core::{Font, Pixels};
|
||||||
use crate::graphics::{self, Antialiasing};
|
use crate::graphics::{self, Antialiasing};
|
||||||
|
|
||||||
/// The settings of a [`Backend`].
|
/// The settings of a [`Renderer`].
|
||||||
///
|
///
|
||||||
/// [`Backend`]: crate::Backend
|
/// [`Renderer`]: crate::Renderer
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
/// The present mode of the [`Backend`].
|
/// The present mode of the [`Renderer`].
|
||||||
///
|
///
|
||||||
/// [`Backend`]: crate::Backend
|
/// [`Renderer`]: crate::Renderer
|
||||||
pub present_mode: wgpu::PresentMode,
|
pub present_mode: wgpu::PresentMode,
|
||||||
|
|
||||||
/// The internal graphics backend to use.
|
/// The graphics backends to use.
|
||||||
pub internal_backend: wgpu::Backends,
|
pub backends: wgpu::Backends,
|
||||||
|
|
||||||
/// The default [`Font`] to use.
|
/// The default [`Font`] to use.
|
||||||
pub default_font: Font,
|
pub default_font: Font,
|
||||||
|
|
@ -33,7 +33,7 @@ impl Default for Settings {
|
||||||
fn default() -> Settings {
|
fn default() -> Settings {
|
||||||
Settings {
|
Settings {
|
||||||
present_mode: wgpu::PresentMode::AutoVsync,
|
present_mode: wgpu::PresentMode::AutoVsync,
|
||||||
internal_backend: wgpu::Backends::all(),
|
backends: wgpu::Backends::all(),
|
||||||
default_font: Font::default(),
|
default_font: Font::default(),
|
||||||
default_text_size: Pixels(16.0),
|
default_text_size: Pixels(16.0),
|
||||||
antialiasing: None,
|
antialiasing: None,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ impl Compositor {
|
||||||
compatible_window: Option<W>,
|
compatible_window: Option<W>,
|
||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||||
backends: settings.internal_backend,
|
backends: settings.backends,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ impl Compositor {
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
if log::max_level() >= log::LevelFilter::Info {
|
if log::max_level() >= log::LevelFilter::Info {
|
||||||
let available_adapters: Vec<_> = instance
|
let available_adapters: Vec<_> = instance
|
||||||
.enumerate_adapters(settings.internal_backend)
|
.enumerate_adapters(settings.backends)
|
||||||
.iter()
|
.iter()
|
||||||
.map(wgpu::Adapter::get_info)
|
.map(wgpu::Adapter::get_info)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
@ -197,8 +197,7 @@ impl Compositor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a [`Compositor`] and its [`Backend`] for the given [`Settings`] and
|
/// Creates a [`Compositor`] with the given [`Settings`] and window.
|
||||||
/// window.
|
|
||||||
pub async fn new<W: compositor::Window>(
|
pub async fn new<W: compositor::Window>(
|
||||||
settings: Settings,
|
settings: Settings,
|
||||||
compatible_window: W,
|
compatible_window: W,
|
||||||
|
|
@ -206,7 +205,7 @@ pub async fn new<W: compositor::Window>(
|
||||||
Compositor::request(settings, Some(compatible_window)).await
|
Compositor::request(settings, Some(compatible_window)).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Presents the given primitives with the given [`Compositor`] and [`Backend`].
|
/// Presents the given primitives with the given [`Compositor`].
|
||||||
pub fn present<T: AsRef<str>>(
|
pub fn present<T: AsRef<str>>(
|
||||||
compositor: &mut Compositor,
|
compositor: &mut Compositor,
|
||||||
renderer: &mut Renderer,
|
renderer: &mut Renderer,
|
||||||
|
|
@ -273,7 +272,7 @@ impl graphics::Compositor for Compositor {
|
||||||
match backend {
|
match backend {
|
||||||
None | Some("wgpu") => Ok(new(
|
None | Some("wgpu") => Ok(new(
|
||||||
Settings {
|
Settings {
|
||||||
internal_backend: wgpu::util::backend_bits_from_env()
|
backends: wgpu::util::backend_bits_from_env()
|
||||||
.unwrap_or(wgpu::Backends::all()),
|
.unwrap_or(wgpu::Backends::all()),
|
||||||
..settings.into()
|
..settings.into()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue