From 8525f8d1f9f8ad3ea234ff485652f4f90acc3f56 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 25 Feb 2025 19:50:36 -0500 Subject: Update --- crates/throwshade/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/throwshade/src/lib.rs') diff --git a/crates/throwshade/src/lib.rs b/crates/throwshade/src/lib.rs index f832703..b408993 100644 --- a/crates/throwshade/src/lib.rs +++ b/crates/throwshade/src/lib.rs @@ -6,6 +6,7 @@ const FRAG: &'static str = include_str!("assets/shaders/throwshade/frag.glsl"); pub struct ThrowShade { pub tickset: u64, pub timeset: f64, + pub author: String, pub shader: Option, } impl ThrowShade { @@ -13,6 +14,7 @@ impl ThrowShade { Self { tickset: 0, timeset: 0.0, + author: String::new(), shader: None, } } @@ -34,6 +36,7 @@ impl ThrowShade { } cfg_if::cfg_if! { + if #[cfg(target_arch = "wasm32")] { struct Game { throwshade: ThrowShade, @@ -51,6 +54,7 @@ cfg_if::cfg_if! { ctx.clear_color(glam::Vec4::new(0.0, 0.0, 0.0, 0.0)); ctx.clear(); s.bind(ctx); + s.set_f32(ctx, "opacity", 0.5); 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; s.set_f32(ctx, "time", elapsed); -- cgit v1.2.3