use config::{app::AppConfig, vulkan::{RendererConfig, VulkanConfig}};
use vulkan::Vulkan;
use winit::{
application::ApplicationHandler,
dpi::{LogicalSize, Size},
};
mod vulkan;
mod utils;
mod engine;
mod error;
mod scene;
mod config;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let event_loop = winit::event_loop::EventLoop::new().unwrap();
event_loop
.run_app(&mut App {
})
.unwrap();
Ok(())
}
struct App {
}
impl ApplicationHandler for App {
fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) {
let window_attributes = winit::window::WindowAttributes::default()
.with_title("Vulkan")
.with_inner_size(Size::Logical(LogicalSize::new(800.0, 600.0)));
let window = event_loop.create_window(window_attributes).unwrap();
let engine_config = RendererConfig::default().set_debug(true).set_debug_log_level(utils::LogLevel::Verbose);
let mut v = Vulkan::init(VulkanConfig::default().set_engine_config(engine_config), &AppConfig::default(), &window).unwrap();
v.destroy();
}
fn window_event(
&mut self,
_event_loop: &winit::event_loop::ActiveEventLoop,
_window_id: winit::window::WindowId,
event: winit::event::WindowEvent,
) {
match event {
winit::event::WindowEvent::CloseRequested => {
}
winit::event::WindowEvent::RedrawRequested => {
}
_ => {}
}
}
}