diff --git a/code/apps/client/source/platform_raylib.c b/code/apps/client/source/platform_raylib.c index 1b0d4c7..a111a20 100644 --- a/code/apps/client/source/platform_raylib.c +++ b/code/apps/client/source/platform_raylib.c @@ -1,5 +1,6 @@ #include "platform.h" #include "raylib.h" +#include "game.h" const uint16_t screenWidth = 800; const uint16_t screenHeight = 450; @@ -17,9 +18,24 @@ uint8_t platform_is_running() { return !WindowShouldClose(); } +void display_conn_status(); + void platform_render() { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(BLACK); DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED); + display_conn_status(); EndDrawing(); } + +void display_conn_status() { + if (game_is_networked()) { + if (network_client_is_connected()) { + DrawText("Connection: online", 5, 5, 12, GREEN); + } else { + DrawText("Connection: offline", 5, 5, 12, RED); + } + } else { + DrawText("Connection: single-player", 5, 5, 12, BLUE); + } +} \ No newline at end of file