Skip to content

Commit

Permalink
add some docs to egui_extras::loaders::install
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Sep 4, 2023
1 parent a8ae600 commit 08cb30b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/egui_extras/src/loaders.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
// TODO: automatic cache eviction

/// Install the default set of loaders:
/// - `file` loader on non-Wasm targets
/// - `http` loader with the `ehttp` feature
/// - `image` loader with the `image` feature
/// - the supported set of image formats is configured by enabling `image` crate features.
/// - `svg` loader with the `svg` feature
///
/// The `file` and `http` loaders are bytes loaders, they do not know how to turn those
/// bytes into an image. `svg` is for loading `.svg` files, and `image` can load any
/// other image format enabled on the `image` crate.
pub fn install(ctx: &egui::Context) {
#[cfg(not(target_arch = "wasm32"))]
ctx.add_bytes_loader(std::sync::Arc::new(self::file_loader::FileLoader::default()));
Expand Down

0 comments on commit 08cb30b

Please sign in to comment.