print controller input
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -12,23 +12,24 @@ use crate::config::LogConfig;
|
||||
|
||||
mod mesh;
|
||||
|
||||
struct TestGame<'a> {
|
||||
input: InputState<'a>,
|
||||
struct TestGame {
|
||||
input: InputState,
|
||||
cam_position: Vector3<f32>,
|
||||
cam_rotation: Quaternion<f32>,
|
||||
cube_mesh: Option<MeshHandle>,
|
||||
cubes: Vec<GameObjectHandle>,
|
||||
log_config: LogConfig,
|
||||
}
|
||||
|
||||
impl Game for TestGame<'_> {
|
||||
impl Game for TestGame {
|
||||
fn on_window_event(self: &mut Self, event: &Event) {
|
||||
self.input.on_window_event(event);
|
||||
}
|
||||
}
|
||||
|
||||
impl TestGame<'_> {
|
||||
impl TestGame {
|
||||
fn game_start(self: &mut Self, renderer: &mut VulkanRenderer) {
|
||||
self.cube_mesh = Some(renderer.upload_mesh(mesh::load_mesh("models/cube.dae", true).into_iter().nth(0).unwrap()));
|
||||
self.cube_mesh = Some(renderer.upload_mesh(mesh::load_mesh("models/cube.dae", self.log_config.mesh_load_info).into_iter().nth(0).unwrap()));
|
||||
println!("Game started.");
|
||||
}
|
||||
|
||||
@@ -89,11 +90,12 @@ fn main() {
|
||||
let log_config = LogConfig::from_file("config/log.toml");
|
||||
|
||||
let mut game = TestGame {
|
||||
input: InputState::new("config/input.toml", &log_config),
|
||||
input: InputState::new("config/input.toml", log_config),
|
||||
cam_rotation: Quaternion::one(),
|
||||
cam_position: Vector3::new(0.0, 0.0, -10.0),
|
||||
cube_mesh: None,
|
||||
cubes: vec![],
|
||||
log_config
|
||||
};
|
||||
|
||||
let line_count = 30;
|
||||
|
||||
Reference in New Issue
Block a user