Toggle lines

This commit is contained in:
2020-10-25 02:08:15 +02:00
parent 8b8bf64e55
commit d6f2b5d385
3 changed files with 74 additions and 13 deletions

View File

@@ -24,6 +24,23 @@ struct TestGame {
texture_index_counter: usize,
last_time: f32,
components: Vec<Box<dyn Updatable>>,
show_grid: bool,
}
impl TestGame {
fn new(toml_path: &str, log_config: LogConfig) -> TestGame {
TestGame {
input: InputState::new(toml_path, log_config),
player: Player::new(),
meshes: vec![],
game_objects: vec![],
log_config,
texture_index_counter: 1,
last_time: 0.0,
components: vec![],
show_grid: false,
}
}
}
impl Game for TestGame {
@@ -50,7 +67,7 @@ impl Game for TestGame {
}
if self.input.button_just_released("test") {
println!("{:?}", self.game_objects[0].get_game_object(renderer).unwrap().position);
renderer.game_data.use_line_pipeline = !renderer.game_data.use_line_pipeline;
}
if self.input.button_just_pressed("reload_shaders") {
@@ -138,16 +155,7 @@ impl TestGame {
fn main() {
let log_config = LogConfig::from_file("config/log.toml");
let mut game = TestGame {
input: InputState::new("config/input.toml", log_config),
player: Player::new(),
meshes: vec![],
game_objects: vec![],
log_config,
texture_index_counter: 1,
last_time: 0.0,
components: vec![],
};
let mut game = TestGame::new("config/input.toml", log_config);
let line_count = 30;
let (mut renderer, event_loop) = VulkanRenderer::init(