Reorganize project to workspace
This commit is contained in:
parent
92c0278ef0
commit
960e2f8a37
39 changed files with 4420 additions and 1189 deletions
18
khors-test/Cargo.toml
Normal file
18
khors-test/Cargo.toml
Normal file
|
@ -0,0 +1,18 @@
|
|||
[package]
|
||||
name = "khors-test"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
khors-core = { path = "../khors-core", version = "0.1.0" }
|
||||
egui-vulkano = { path = "../vendor/egui-vulkano", version = "0.1.0" }
|
||||
khors-graphics = { path = "../modules/khors-graphics", version = "0.1.0" }
|
||||
khors-window = { path = "../modules/khors-window", version = "0.1.0" }
|
||||
khors-config = { path = "../modules/khors-config", version = "0.1.0" }
|
||||
khors-steel = { path = "../modules/khors-steel", version = "0.1.0" }
|
||||
|
||||
anyhow = "1.0.80"
|
||||
winit = { version = "0.29.15",features = ["rwh_05"] }
|
||||
tokio = { version = "1.36.0", features = ["full"] }
|
51
khors-test/src/main.rs
Normal file
51
khors-test/src/main.rs
Normal file
|
@ -0,0 +1,51 @@
|
|||
use anyhow::Result;
|
||||
|
||||
use khors_config::ConfigModule;
|
||||
use khors_core::app::App;
|
||||
use khors_graphics::RenderModule;
|
||||
use khors_window::WindowModule;
|
||||
use tokio::runtime::Builder;
|
||||
use winit::event_loop::{ControlFlow, EventLoopBuilder};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let event_loop = EventLoopBuilder::new().build()?;
|
||||
|
||||
let runtime = Builder::new_multi_thread().enable_all().build()?;
|
||||
// let (event_tx, event_rx) = flume::unbounded();
|
||||
|
||||
runtime.block_on(async {
|
||||
runtime.spawn(async move {
|
||||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||
// let _event = event_rx.recv_async().await.unwrap();
|
||||
// println!(
|
||||
// "Tokio got event: {:?} on thread: {:?}",
|
||||
// event,
|
||||
// std::thread::current().id()
|
||||
// );
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let mut app = App::new(); // TODO: Move renderer into App
|
||||
app.create_window(&event_loop);
|
||||
|
||||
app.push_module(ConfigModule::new);
|
||||
app.push_module(WindowModule::new);
|
||||
app.push_render_module(RenderModule::new);
|
||||
|
||||
event_loop.run(move |event, elwt| {
|
||||
elwt.set_control_flow(ControlFlow::Poll);
|
||||
|
||||
if app
|
||||
.process_event_loop(event, elwt)
|
||||
.expect("Execution failed")
|
||||
{
|
||||
elwt.exit();
|
||||
}
|
||||
|
||||
// event_tx.send(event.clone()).unwrap();
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue