Toggle lines
This commit is contained in:
30
src/main.rs
30
src/main.rs
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user