display conn status
parent
dbc7617f61
commit
55ea1e740f
|
@ -1,5 +1,6 @@
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
#include "game.h"
|
||||||
|
|
||||||
const uint16_t screenWidth = 800;
|
const uint16_t screenWidth = 800;
|
||||||
const uint16_t screenHeight = 450;
|
const uint16_t screenHeight = 450;
|
||||||
|
@ -17,9 +18,24 @@ uint8_t platform_is_running() {
|
||||||
return !WindowShouldClose();
|
return !WindowShouldClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void display_conn_status();
|
||||||
|
|
||||||
void platform_render() {
|
void platform_render() {
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(BLACK);
|
||||||
DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED);
|
DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED);
|
||||||
|
display_conn_status();
|
||||||
EndDrawing();
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue