Skip to content

Commit

Permalink
Use ExtractResource trait for EguiManagedTextures and EguiUserTextures (
Browse files Browse the repository at this point in the history
mvlabat#210)

Co-authored-by: mvlabat <mvlabat@gmail.com>
  • Loading branch information
2 people authored and Schmarni-Dev committed Dec 23, 2023
1 parent 4bdf854 commit 04f2e38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ impl Plugin for EguiPlugin {
world.init_resource::<EguiUserTextures>();
world.init_resource::<EguiMousePosition>();
world.insert_resource(TouchId::default());
app.add_plugins(ExtractResourcePlugin::<EguiUserTextures>::default());
app.add_plugins(ExtractResourcePlugin::<ExtractedEguiManagedTextures>::default());
app.add_plugins(ExtractResourcePlugin::<EguiSettings>::default());
app.add_plugins(ExtractResourcePlugin::<EguiUserTextures>::default());
app.add_plugins(ExtractResourcePlugin::<ExtractedEguiManagedTextures>::default());
Expand Down
4 changes: 4 additions & 0 deletions src/render_systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ use bevy::{
utils::HashMap,
};

/// Extracted Egui settings.
#[derive(Resource, Deref, DerefMut, Default)]
pub struct ExtractedEguiSettings(pub EguiSettings);

/// The extracted version of [`EguiManagedTextures`].
#[derive(Debug, Resource)]
pub struct ExtractedEguiManagedTextures(pub HashMap<(Entity, u64), Handle<Image>>);
Expand Down

0 comments on commit 04f2e38

Please sign in to comment.