summaryrefslogtreecommitdiff
path: root/crates/throwshade/src/lib.rs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-02-25 19:50:36 -0500
committerLLLL Colonq <llll@colonq>2025-02-25 19:50:36 -0500
commit8525f8d1f9f8ad3ea234ff485652f4f90acc3f56 (patch)
treef82615bbdf90c832c610720cb3317178089c7948 /crates/throwshade/src/lib.rs
parentcfc11a79c914abc5012ffabb5b0697487ae1acfd (diff)
Update
Diffstat (limited to 'crates/throwshade/src/lib.rs')
-rw-r--r--crates/throwshade/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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<shader::Shader>,
}
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);