summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-05-02 23:02:09 -0400
committerLLLL Colonq <llll@colonq>2025-05-02 23:02:09 -0400
commit0271a51582aa68a7890920605948e618a4c440eb (patch)
tree5d0e81eae29913a7da03530cd97cff33455b1678 /crates
parent9e586a12b0db0292d9fb41e4ec99a3e1fd912d85 (diff)
Update throwshade
Diffstat (limited to 'crates')
-rw-r--r--crates/renderer/src/overlay/multi.rs2
-rw-r--r--crates/throwshade/src/lib.rs12
2 files changed, 8 insertions, 6 deletions
diff --git a/crates/renderer/src/overlay/multi.rs b/crates/renderer/src/overlay/multi.rs
index 7737a1e..41ec12f 100644
--- a/crates/renderer/src/overlay/multi.rs
+++ b/crates/renderer/src/overlay/multi.rs
@@ -188,7 +188,7 @@ impl teleia::state::Game for Overlay {
self.term.update(ctx, &self.fb);
ctx.clear_color(glam::Vec4::new(0.0, 0.0, 0.0, 0.0));
ctx.clear();
- self.term.render(ctx, &glam::Vec2::new(0.0, 0.0));
+ self.term.render(ctx, &glam::Vec2::new(32.0, 32.0));
Ok(())
}
}
diff --git a/crates/throwshade/src/lib.rs b/crates/throwshade/src/lib.rs
index f6ee8a6..ab1c9bf 100644
--- a/crates/throwshade/src/lib.rs
+++ b/crates/throwshade/src/lib.rs
@@ -41,7 +41,7 @@ cfg_if::cfg_if! {
throwshade: ThrowShade,
}
impl Game {
- pub async fn new(_ctx: &context::Context) -> Self {
+ pub fn new(_ctx: &context::Context) -> Self {
Self {
throwshade: ThrowShade::new(),
}
@@ -65,18 +65,20 @@ cfg_if::cfg_if! {
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
- pub async fn main_js() {
- teleia::run(1920, 1080, teleia::Options::NORESIZE, Game::new).await;
+ pub fn main_js() {
+ teleia::run(1920, 1080, teleia::Options::NORESIZE, Game::new);
}
#[wasm_bindgen]
- pub async fn set_shader(s: &str) {
+ pub async fn set_shader(s: &str) -> Result<(), String> {
contextualize(|ctx, st, g: &mut Game| {
log::info!("set shader: {}", s);
if let Err(e) = g.throwshade.set(ctx, st, &s) {
log::warn!("error compiling shader: {}", e);
g.throwshade.shader = None;
+ return Err(format!("{}", e));
}
- });
+ Ok(())
+ })
}
}
}