diff --git a/code/apps/client/source/game.c b/code/apps/client/source/game.c index c93d70c..ac4b9f1 100644 --- a/code/apps/client/source/game.c +++ b/code/apps/client/source/game.c @@ -132,7 +132,7 @@ uint8_t game_is_running() { } void game_input() { - + platform_input(); } void game_update() { diff --git a/code/apps/client/source/platform_raylib.c b/code/apps/client/source/platform_raylib.c index a44846c..085d5b5 100644 --- a/code/apps/client/source/platform_raylib.c +++ b/code/apps/client/source/platform_raylib.c @@ -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); diff --git a/code/apps/client/source/platform_text.c b/code/apps/client/source/platform_text.c index d64b1bd..8610ee6 100644 --- a/code/apps/client/source/platform_text.c +++ b/code/apps/client/source/platform_text.c @@ -14,6 +14,10 @@ void platform_shutdown() { is_running = 0; } +void platform_input() { + +} + uint8_t platform_is_running() { return is_running; } diff --git a/code/common/platform.h b/code/common/platform.h index df9f523..740d61e 100644 --- a/code/common/platform.h +++ b/code/common/platform.h @@ -5,4 +5,5 @@ void platform_init(); void platform_shutdown(); uint8_t platform_is_running(); +void platform_input(); void platform_render();