Skip to content

Commit

Permalink
Tweak the glass app type implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Nov 20, 2023
1 parent 504e0c2 commit 1f7740e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 8 additions & 0 deletions run_all_examples.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cargo run --example hello_world
cargo run --example triangle
cargo run --example shader_with_includes
cargo run --example quad
cargo run --example multiple_windows
cargo run --example game_of_life
cargo run --example egui_gui --features "egui_gui egui_demo"
cargo run --example fluid_sim --features "egui_gui"
3 changes: 2 additions & 1 deletion run_all_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ cargo run --example shader_with_includes
cargo run --example quad
cargo run --example multiple_windows
cargo run --example game_of_life
cargo run --example egui_gui --features "egui_gui"
cargo run --example egui_gui --features "egui_gui egui_demo"
cargo run --example fluid_sim --features "egui_gui"
10 changes: 5 additions & 5 deletions src/glass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ use crate::{
/// [`Glass`] is an application that exposes an easy to use API to organize your winit applications
/// which render using wgpu. Just impl [`GlassApp`] for your application (of any type) and you
/// are good to go.
pub struct Glass<A> {
app: A,
pub struct Glass {
app: Box<dyn GlassApp>,
config: GlassConfig,
}

impl<A: GlassApp + 'static> Glass<A> {
pub fn new(app: A, config: GlassConfig) -> Glass<A> {
impl Glass {
pub fn new(app: impl GlassApp + 'static, config: GlassConfig) -> Glass {
Glass {
app,
app: Box::new(app),
config,
}
}
Expand Down

0 comments on commit 1f7740e

Please sign in to comment.