From 472eadbc178ed70a4acc9339d34f0bb2fa04b0a1 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 14 Feb 2025 19:40:28 -0500 Subject: Before fucked up undo situation --- src/common/overlay/throwshade.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/common/overlay/throwshade.rs (limited to 'src/common/overlay/throwshade.rs') diff --git a/src/common/overlay/throwshade.rs b/src/common/overlay/throwshade.rs new file mode 100644 index 0000000..d7ac430 --- /dev/null +++ b/src/common/overlay/throwshade.rs @@ -0,0 +1,23 @@ +use teleia::*; + +const VERT: &'static str = include_str!("assets/shaders/throwshade/vert.glsl"); +const FRAG: &'static str = include_str!("assets/shaders/throwshade/frag.glsl"); + +pub struct ThrowShade { + pub shader: Option, +} +impl ThrowShade { + pub fn new() -> Self { + Self { + shader: None, + } + } + pub fn set(&mut self, ctx: &context::Context, src: &str) { + let fsrc = format!("{}\n{}\n", FRAG, src); + if let Some(s) = &mut self.shader { + s.replace(ctx, VERT, &fsrc); + } else { + self.shader = Some(shader::Shader::new_nolib(ctx, VERT, &fsrc)); + } + } +} -- cgit v1.2.3