1
0
Fork 0

Move all resources into res folder

This commit is contained in:
Florian RICHER 2022-06-15 20:44:29 +02:00
parent 2fb1a1dc7c
commit 4723cf513a
4 changed files with 3 additions and 3 deletions

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -149,7 +149,7 @@ impl State {
label: Some("texture_bind_group_layout"), 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 = let diffuse_texture =
Texture::from_bytes(&device, &queue, diffuse_bytes, "happy-tree.png") Texture::from_bytes(&device, &queue, diffuse_bytes, "happy-tree.png")
.unwrap(); .unwrap();
@ -169,7 +169,7 @@ impl State {
label: Some("diffuse_bind_group"), 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( let diffuse_texture_pikachu = Texture::from_bytes(
&device, &device,
&queue, &queue,
@ -196,7 +196,7 @@ impl State {
let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
label: Some("Shader"), 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 { let camera = Camera {