camera zoom

isolation_bkp/dynres
Dominik Madarász 2021-05-07 14:27:51 +02:00
parent 2ddf1e48fd
commit 1b06c13f5e
4 changed files with 14 additions and 1 deletions

View File

@ -132,7 +132,7 @@ uint8_t game_is_running() {
}
void game_input() {
platform_input();
}
void game_update() {

View File

@ -28,6 +28,14 @@ uint8_t platform_is_running() {
return !WindowShouldClose();
}
void platform_input() {
float mouse_z = GetMouseWheelMove();
if (mouse_z != 0.0f) {
render_camera.zoom = zpl_clamp(render_camera.zoom+mouse_z*0.04f, 0.01f, 1.0f);
}
}
void display_conn_status();
void DEBUG_draw_entities(uint64_t key, entity_view data);

View File

@ -14,6 +14,10 @@ void platform_shutdown() {
is_running = 0;
}
void platform_input() {
}
uint8_t platform_is_running() {
return is_running;
}

View File

@ -5,4 +5,5 @@ void platform_init();
void platform_shutdown();
uint8_t platform_is_running();
void platform_input();
void platform_render();