summary refs log tree commit diff
path: root/build.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-07-17 18:43:05 -0700
committerIrene Knapp <ireneista@irenes.space>2026-07-18 01:14:49 -0700
commitf70917c8aae0d184ed7ce5e63e6347fdc21921e3 (patch)
treebdc7f0b8c45c8cba5a07786590053212185406c2 /build.rs
parentf7e6dec079dcbbc26a9e047cf2b0acf23c091836 (diff)
load a texture image
also refactor buffer management a little

this doesn't yet draw the texture

Change-Id: Id2efa761223a588bf599041ac525c3b988f0113b
Force-Push: yes
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs32
1 files changed, 31 insertions, 1 deletions
diff --git a/build.rs b/build.rs
index b4ffa72..7399346 100644
--- a/build.rs
+++ b/build.rs
@@ -10,7 +10,16 @@ fn main() {
   }
 }
 
-fn process_all () -> std::io::Result<()> {
+
+fn process_all() -> std::io::Result<()> {
+  process_shaders()?;
+  process_textures()?;
+
+  Ok(())
+}
+
+
+fn process_shaders() -> std::io::Result<()> {
   let out_dir = env::var_os("OUT_DIR").unwrap();
 
   for input in fs::read_dir("shaders")? {
@@ -51,3 +60,24 @@ fn process_all () -> std::io::Result<()> {
   Ok(())
 }
 
+
+fn process_textures() -> std::io::Result<()> {
+  for input in fs::read_dir("textures")? {
+    let input_path = input?.path();
+    if !input_path.is_file() {
+      continue;
+    }
+
+    if let Some(Some(filename)) = input_path.file_name()
+                                            .map(|name| name.to_str())
+       && filename.get(.. 1) == Some(".")
+    {
+      continue;
+    }
+
+    println!("cargo::rerun-if-changed={}", input_path.display());
+  }
+
+  Ok(())
+}
+