From cfc11a79c914abc5012ffabb5b0697487ae1acfd Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 18 Feb 2025 19:42:51 -0500 Subject: Fix clear on web --- crates/throwshade/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates') diff --git a/crates/throwshade/src/lib.rs b/crates/throwshade/src/lib.rs index 2ac139e..f832703 100644 --- a/crates/throwshade/src/lib.rs +++ b/crates/throwshade/src/lib.rs @@ -48,6 +48,8 @@ cfg_if::cfg_if! { impl state::Game for Game { fn render(&mut self, ctx: &context::Context, st: &mut state::State) -> Option<()> { if let Some(s) = &self.throwshade.shader { + ctx.clear_color(glam::Vec4::new(0.0, 0.0, 0.0, 0.0)); + ctx.clear(); s.bind(ctx); s.set_vec2(ctx, "resolution", &glam::Vec2::new(ctx.render_width, ctx.render_height)); let elapsed = (st.tick - self.throwshade.tickset) as f32 / 60.0; -- cgit v1.2.3