Skip to content

Commit 721ab7d

Browse files
[arch] reorganize asset/shader placement in repo
1 parent de0ff78 commit 721ab7d

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Rust Game Engine
44

55
<div style="text-align: center;">
66

7-
![Under Construction](assets/repo/under_construction.png)
7+
![Under Construction](assets/_repo/under_construction.png)
88

99
</div>

crates/eqx_core/src/util_macros.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#[macro_export]
2+
macro_rules! shader_src {
3+
($path:literal) => {
4+
include_str!(concat!(
5+
env!("CARGO_MANIFEST_DIR"),
6+
"/../../shaders/",
7+
$path,
8+
".wgsl"
9+
))
10+
};
11+
}
12+
13+
#[macro_export]
14+
macro_rules! asset_file {
15+
($path:literal) => {
16+
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../../assets/", $path))
17+
};
18+
}

crates/eqx_window/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
winit = { version = "0.29", features = ["rwh_05"] }
87
bytemuck = { version = "1.22", features = ["derive"] }
8+
eqx_core = { path = "../eqx_core", version = "0.1.0" }
99
cgmath = "0.18"
10+
eqx_app = { path = "../eqx_app", version = "0.1.0" }
11+
image = { version = "0.25", default-features = false, features = ["png"] }
1012
log = "0.4"
11-
wgpu = "24.0"
1213
pollster = "0.2"
13-
eqx_app = { path = "../eqx_app", version = "0.1.0" }
14+
winit = { version = "0.29", features = ["rwh_05"] }
15+
wgpu = "24.0"

crates/eqx_window/src/window.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ impl<'a> State<'a> {
8484

8585
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
8686
label: Some("TrigShader"),
87-
source: wgpu::ShaderSource::Wgsl(
88-
include_str!("../../../shaders/trig/shader.wgsl").into(),
89-
),
87+
source: wgpu::ShaderSource::Wgsl(eqx_core::shader_src!("trig/shader").into()),
9088
});
9189

9290
let render_pipeline_layout =

0 commit comments

Comments
 (0)