aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-01-21 21:58:02 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-01-21 21:58:02 +0100
commitb48567d87fd0eac152e387d633ae782aea89cb9e (patch)
treea8ee8c83907f1273d2d24a3c0bfc7a9065cabee8 /src/main.cpp
parent142a370cba076a7cf593c7a48b5414e992311a20 (diff)
Fix kbd + camera movements
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a2134bd..fb6319e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -44,7 +44,7 @@ int main() {
// Image dimensions
const float aspect_ratio = 16.0 / 9.0;
// const float aspect_ratio = 1;
- const uint32_t width = 1920;
+ const uint32_t width = 400;
const uint32_t height = width / aspect_ratio;
window wnd { width , height };
@@ -72,7 +72,18 @@ int main() {
break;
}
case EVENT_TYPES::KEY_PRESS: {
- std::cerr << (uint8_t)event.keycode << std::endl;
+ switch((uint8_t)event.keycode) {
+ case('w'): {
+ renderer.mapped_data->cam.move(renderer.mapped_data->cam.forward * 0.1);
+ break;
+ }
+ case('s'): {
+ renderer.mapped_data->cam.move(-renderer.mapped_data->cam.forward * 0.1);
+ break;
+ }
+ default:
+ std::cerr << (uint8_t)event.keycode << std::endl;
+ }
}
default: {
}