Fix ios and apple compilation

This commit is contained in:
Maximilian Ammann 2022-01-03 10:23:56 +01:00
parent 089db3c0e7
commit b5f9a64183
2 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,4 @@
use crate::io::cache::Cache;
pub use std::time::Instant;
pub const COLOR_TEXTURE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unorm;
@ -15,5 +16,16 @@ pub fn main() {
.build(&event_loop)
.unwrap();
pollster::block_on(crate::main_loop::setup(window, event_loop));
let mut cache_io = Cache::new();
let cache_main = cache_io.clone();
std::thread::spawn(move || {
cache_io.run_loop();
});
pollster::block_on(crate::main_loop::setup(
window,
event_loop,
Box::new(cache_main),
));
}

View File

@ -1,6 +1,7 @@
use winit::event_loop::EventLoop;
use winit::window::WindowBuilder;
use crate::io::cache::Cache;
pub use std::time::Instant;
// macOS and iOS (Metal)
@ -16,5 +17,16 @@ pub fn mapr_apple_main() {
.build(&event_loop)
.unwrap();
pollster::block_on(crate::main_loop::setup(window, event_loop));
let mut cache_io = Cache::new();
let cache_main = cache_io.clone();
std::thread::spawn(move || {
cache_io.run_loop();
});
pollster::block_on(crate::main_loop::setup(
window,
event_loop,
Box::new(cache_main),
));
}