feat: model node :D

This commit is contained in:
Nova
2022-08-17 19:08:48 -04:00
parent 5a5a7d50c9
commit 6c172a98b6
6 changed files with 131 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
mod core;
mod nodes;
use crate::nodes::model::{MODELS_TO_DROP, MODEL_REGISTRY};
use self::core::eventloop::EventLoop;
use anyhow::Result;
use clap::Parser;
@@ -44,8 +46,12 @@ fn main() -> Result<()> {
.spawn(move || event_loop(event_stop_rx))?;
stereokit.run(
|_draw_ctx| {
|draw_ctx| {
nodes::root::Root::logic_step(stereokit.time_elapsed());
for model in MODEL_REGISTRY.get_valid_contents() {
model.draw(&stereokit, draw_ctx);
}
MODELS_TO_DROP.lock().clear();
},
|| {
println!("Cleanly shut down StereoKit");