This commit is contained in:
2021-01-31 02:08:53 -08:00
parent f44f8201b9
commit 3585c053ae
3 changed files with 49 additions and 34 deletions

View File

@@ -212,18 +212,20 @@ async fn main() {
let mut swap_chain = device.create_swap_chain(&surface, &sc_desc);
log::info!("Done doing the loading part...");
// Init
let mut runtime = runtime::Runtime::init(&sc_desc, &device, &queue);
// Not sure why this is guarded, maybe we don't handle the event loop timing?
#[cfg(not(target_arch = "wasm32"))]
let mut last_update_inst = Instant::now();
log::info!("Entering render loop...");
// Load up the renderer (and the resources)
let mut renderer = render::Renderer::init(&device, &sc_desc);
let (plane_vertex_buffer, plane_index_buffer) = Renderer::load_mesh_to_buffer(device, "plane.obj");
// Init, this wants the references to the buffers...
let mut runtime = runtime::Runtime::init(&sc_desc, &device, &queue);
// This is just an winit event loop
event_loop.run(move |event, _, control_flow| {