From 4723cf513a4abe6ef5495ab1bf2d74032c823409 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Wed, 15 Jun 2022 20:44:29 +0200 Subject: [PATCH] Move all resources into res folder --- {src => res/images}/happy-tree.png | Bin {src => res/images}/pikachu.png | Bin src/shader.wgsl => res/shaders/main.wgsl | 0 src/state.rs | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename {src => res/images}/happy-tree.png (100%) rename {src => res/images}/pikachu.png (100%) rename src/shader.wgsl => res/shaders/main.wgsl (100%) diff --git a/src/happy-tree.png b/res/images/happy-tree.png similarity index 100% rename from src/happy-tree.png rename to res/images/happy-tree.png diff --git a/src/pikachu.png b/res/images/pikachu.png similarity index 100% rename from src/pikachu.png rename to res/images/pikachu.png diff --git a/src/shader.wgsl b/res/shaders/main.wgsl similarity index 100% rename from src/shader.wgsl rename to res/shaders/main.wgsl diff --git a/src/state.rs b/src/state.rs index 48da1cb..fe8758d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -149,7 +149,7 @@ impl State { label: Some("texture_bind_group_layout"), }); - let diffuse_bytes = include_bytes!("happy-tree.png"); + let diffuse_bytes = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/res/images/happy-tree.png")); let diffuse_texture = Texture::from_bytes(&device, &queue, diffuse_bytes, "happy-tree.png") .unwrap(); @@ -169,7 +169,7 @@ impl State { label: Some("diffuse_bind_group"), }); - let diffuse_bytes_pikachu = include_bytes!("pikachu.png"); + let diffuse_bytes_pikachu = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/res/images/pikachu.png")); let diffuse_texture_pikachu = Texture::from_bytes( &device, &queue, @@ -196,7 +196,7 @@ impl State { let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { label: Some("Shader"), - source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), + source: wgpu::ShaderSource::Wgsl(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/res/shaders/main.wgsl")).into()), }); let camera = Camera {