This commit is contained in:
2020-11-07 17:54:30 +01:00
parent 38ea41b550
commit a8f8bbf36e
5 changed files with 88 additions and 33 deletions

View File

@@ -1,7 +1,7 @@
use cgmath::{Matrix4, vec3, Vector3, Vector4};
use winit::event::Event;
use crate::config::LogConfig;
use crate::config::{LogConfig, RenderConfig};
use crate::gameobject::{GameObject, GameObjectHandle, Updatable};
use crate::input::InputState;
use crate::player::Player;
@@ -171,15 +171,18 @@ fn main() {
let mut game = TestGame::new("config/input.toml", log_config);
let line_count = 30;
let line_vertices = (-line_count..=line_count)
.flat_map(|it| vec![
LinePoint { position: [it as f32, 0., -line_count as f32] },
LinePoint { position: [it as f32, 0., line_count as f32] },
LinePoint { position: [-line_count as f32, 0., it as f32] },
LinePoint { position: [line_count as f32, 0., it as f32] },
]).collect();
let (mut renderer, event_loop) = VulkanRenderer::init(
(-line_count..=line_count)
.flat_map(|it| vec![
LinePoint { position: [it as f32, 0., -line_count as f32] },
LinePoint { position: [it as f32, 0., line_count as f32] },
LinePoint { position: [-line_count as f32, 0., it as f32] },
LinePoint { position: [line_count as f32, 0., it as f32] },
]).collect(),
line_vertices,
log_config.vulkan_validation_layers,
RenderConfig::from_file("config/graphics.toml")
);
game.game_start(&mut renderer);