From f70917c8aae0d184ed7ce5e63e6347fdc21921e3 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 17 Jul 2026 18:43:05 -0700 Subject: load a texture image also refactor buffer management a little this doesn't yet draw the texture Change-Id: Id2efa761223a588bf599041ac525c3b988f0113b Force-Push: yes --- build.rs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'build.rs') 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(()) +} + -- cgit 1.4.1