summaryrefslogtreecommitdiff
path: root/src/render.rs
diff options
context:
space:
mode:
authorIsaac Clayton2022-01-22 10:13:03 +0100
committerIsaac Clayton2022-01-22 10:13:03 +0100
commit449089e80cd294cbf2016ca8b76ba2a14c6637ab (patch)
treebfb2ac459fccb9b74fe207c6dc2abb427e11b0b4 /src/render.rs
parent4c947cbed372159fccffbdf6dd639262404ca6e8 (diff)
working on writing quadtree to texture
Diffstat (limited to 'src/render.rs')
-rw-r--r--src/render.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/render.rs b/src/render.rs
index 964a022..6939ee8 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -14,6 +14,7 @@ struct Vertex {
struct Stage {
pipeline: Pipeline,
bindings: Bindings,
+ texture: Texture,
}
impl Stage {
@@ -51,12 +52,17 @@ impl Stage {
shader,
);
- Stage { pipeline, bindings }
+ Stage { pipeline, bindings, texture }
}
}
impl EventHandler for Stage {
- fn update(&mut self, _ctx: &mut Context) {}
+ fn update(&mut self, ctx: &mut Context) {
+ let t = date::now();
+ let bright = t.sin()*0.5+0.5;
+ let bytes = [(bright * 255.0) as u8; 512*512*4];
+ self.texture.update(ctx, &bytes)
+ }
fn draw(&mut self, ctx: &mut Context) {
ctx.begin_default_pass(Default::default());