Skip to content

Commit ba9dfa4

Browse files
committed
WIP: Refactor render, window creation into separate modules
In addition, upgrade to winit 0.20.0-alpha1. I saw no point in performing such a major refactor if I'd have to do it all over again once winit 0.20 inverted control flow & otherwise broke API compatibility. There are still many rough edges here, especially w/r/t IntentionalPanic and render::setup.
1 parent 98733d9 commit ba9dfa4

13 files changed

Lines changed: 1012 additions & 609 deletions

File tree

Cargo.lock

Lines changed: 234 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ sample = "0.10.0"
2525
vulkano = "0.13.0"
2626
vulkano-shaders = "0.13.0"
2727
vulkano-win = "0.13.0"
28-
winit = "0.19.1"
28+
winit = "0.20.0-alpha1"
29+
30+
[patch.crates-io]
31+
vulkano = { git = "https://github.com/milkey-mouse/vulkano.git", branch = "winit-0.20.0-alpha1" }
32+
vulkano-shaders = { git = "https://github.com/milkey-mouse/vulkano.git", branch = "winit-0.20.0-alpha1" }
33+
vulkano-win = { git = "https://github.com/milkey-mouse/vulkano.git", branch = "winit-0.20.0-alpha1" }

generate-shader-macros.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ done | head -n-1 | if [ "$1" == "--mod" ]; then
3737
cat
3838
echo '}'
3939
else
40-
sed 's/^ //' | tee src/render/shaders.rs
40+
sed 's/^ //' | tee src/shaders.rs
4141
fi

src/audio.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ use std::convert::TryFrom;
22

33
mod mixer;
44
pub mod music;
5-
pub mod sink;
6-
pub mod source;
5+
mod sink;
6+
mod source;
7+
8+
pub use sink::AudioThread;
79

810
// this probably would be i16 were it not for Interpolators requiring f64 frames
911
pub type SampleFormat = f64;
@@ -16,15 +18,6 @@ pub enum Channels {
1618
Mono,
1719
}
1820

19-
/*impl Into<u8> for Channels {
20-
fn into(self) -> u8 {
21-
match self {
22-
Channels::Mono => 1,
23-
Channels::Stereo => 2,
24-
}
25-
}
26-
}*/
27-
2821
impl TryFrom<u32> for Channels {
2922
type Error = ();
3023

src/audio/sink.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ impl<'a> Sink<'a> for DummySink {
4242
#[derive(Clone)]
4343
pub struct AudioThread<'a> {
4444
mixer: Mixer<'a>,
45-
stopping: Arc<AtomicBool>,
4645
format: Format,
46+
stopping: Arc<AtomicBool>,
4747
}
4848

4949
impl<'a> Sink<'a> for AudioThread<'a> {

0 commit comments

Comments
 (0)