From d426fd39c065583d2602ac4d6559f0882a73414d Mon Sep 17 00:00:00 2001 From: zomseffen Date: Sun, 2 Jun 2024 18:33:34 +0200 Subject: [PATCH] clean up --- src/app_data.rs | 2 -- src/main.rs | 9 ++++----- src/primitives/cube.rs | 2 +- src/scene.rs | 6 ++---- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/app_data.rs b/src/app_data.rs index e3489fb..6393ff9 100644 --- a/src/app_data.rs +++ b/src/app_data.rs @@ -1,7 +1,5 @@ use vulkanalia::prelude::v1_0::*; -use crate::scene; - // The Vulkan handles and associated properties used by our Vulkan app. #[derive(Clone, Debug, Default)] pub struct AppData { diff --git a/src/main.rs b/src/main.rs index 208902e..c747232 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use anyhow::{anyhow, Result}; use log::*; -use winit::dpi::{LogicalSize, LogicalPosition, PhysicalPosition}; +use winit::dpi::{LogicalSize, LogicalPosition}; use winit::event::{Event, WindowEvent}; use winit::event_loop::EventLoop; use winit::window::{Window, WindowBuilder}; @@ -18,7 +18,6 @@ use vulkanalia::prelude::v1_0::*; use vulkanalia::Version; use vulkanalia::bytecode::Bytecode; -use core::time; use std::collections::HashSet; use std::ffi::CStr; use std::os::raw::c_void; @@ -28,7 +27,7 @@ use vulkanalia::vk::ExtDebugUtilsExtension; use vulkanalia::vk::KhrSurfaceExtension; use vulkanalia::vk::KhrSwapchainExtension; -use cgmath::{vec2, vec3, Matrix, SquareMatrix}; +use cgmath::Matrix; use std::mem::size_of; use std::ptr::copy_nonoverlapping as memcpy; @@ -162,7 +161,7 @@ impl App { let loader = LibloadingLoader::new(LIBRARY)?; let entry = Entry::new(loader).map_err(|b| anyhow!("{}", b))?; let mut data = app_data::AppData::default(); - data.use_geometry_shader = true; + data.use_geometry_shader = false; let mut scene_handler = scene::Scene::default(); //load_model::load_model(&mut data)?; @@ -189,7 +188,7 @@ impl App { image::create_texture_image_view(&device, &mut data)?; image::create_texture_sampler(&device, &mut data)?; - scene_handler.prepare_data(&instance, &device, &data); + scene_handler.prepare_data(&instance, &device, &data)?; buffer::create_uniform_buffers(&instance, &device, &mut data)?; buffer::create_descriptor_pool(&device, &mut data)?; diff --git a/src/primitives/cube.rs b/src/primitives/cube.rs index 8666888..53afd86 100644 --- a/src/primitives/cube.rs +++ b/src/primitives/cube.rs @@ -1,5 +1,5 @@ use vulkanalia::prelude::v1_0::*; -use cgmath::{vec2, vec3, Matrix, SquareMatrix}; +use cgmath::vec3; use crate::vertex; use crate::scene::Scene; diff --git a/src/scene.rs b/src/scene.rs index d85274c..59657f7 100644 --- a/src/scene.rs +++ b/src/scene.rs @@ -1,9 +1,7 @@ -use std::thread::yield_now; - use vulkanalia::prelude::v1_0::*; -use anyhow::{anyhow, Result}; +use anyhow::Result; -use cgmath::{vec2, vec3, Matrix, SquareMatrix}; +use cgmath::{vec2, vec3}; use crate::app_data::AppData; use crate::buffer;