diff --git a/Cargo.lock b/Cargo.lock index 605bd184..9c0775ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -762,6 +762,19 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "embed-resource" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +dependencies = [ + "cc", + "rustc_version", + "toml", + "vswhom", + "winreg", +] + [[package]] name = "env_logger" version = "0.10.1" @@ -2045,6 +2058,7 @@ version = "0.1.0" dependencies = [ "async-thread", "cpal", + "embed-resource", "env_logger", "fluidlite", "fps_ticker", @@ -2893,6 +2907,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.38.26" @@ -2963,6 +2986,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e388332cd64eb80cd595a00941baf513caffae8dce9cfd0467fc9c66397dade6" +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + [[package]] name = "serde" version = "1.0.193" @@ -3434,6 +3463,26 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "walkdir" version = "2.4.0" @@ -4173,6 +4222,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "x11-dl" version = "2.21.0" diff --git a/neothesia/Cargo.toml b/neothesia/Cargo.toml index 04eb1fbd..0c05239f 100644 --- a/neothesia/Cargo.toml +++ b/neothesia/Cargo.toml @@ -47,3 +47,6 @@ iced_widget = { git = "https://github.com/iced-rs/iced.git", rev="fc285d3e461626 [[bin]] name = "neothesia" + +[build-dependencies] +embed-resource = "2.4.0" diff --git a/neothesia/build.rs b/neothesia/build.rs new file mode 100644 index 00000000..f9b40498 --- /dev/null +++ b/neothesia/build.rs @@ -0,0 +1,4 @@ +fn main() { + #[cfg(target_os = "windows")] + embed_resource::compile("manifest.rc", embed_resource::NONE); +} diff --git a/neothesia/icon.ico b/neothesia/icon.ico new file mode 100644 index 00000000..c2f8232f Binary files /dev/null and b/neothesia/icon.ico differ diff --git a/neothesia/icon.rgba b/neothesia/icon.rgba new file mode 100644 index 00000000..5f450712 Binary files /dev/null and b/neothesia/icon.rgba differ diff --git a/neothesia/manifest.rc b/neothesia/manifest.rc new file mode 100644 index 00000000..4af4df1c --- /dev/null +++ b/neothesia/manifest.rc @@ -0,0 +1 @@ +neothesia_icon ICON "icon.ico" diff --git a/neothesia/src/main.rs b/neothesia/src/main.rs index 709c19be..af801cc5 100644 --- a/neothesia/src/main.rs +++ b/neothesia/src/main.rs @@ -291,6 +291,10 @@ fn init(builder: winit::window::WindowBuilder) -> (EventLoop, Ta let window = builder.build(&event_loop).unwrap(); + window.set_window_icon(Some( + winit::window::Icon::from_rgba(include_bytes!("../icon.rgba").to_vec(), 256, 256).unwrap(), + )); + let window_state = WindowState::new(&window); let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { backends: wgpu_jumpstart::default_backends(),