network: fix mingw build

pull/1290/head
flightlessmango 2 months ago
parent a4862f5461
commit 1baecfc493

@ -1444,6 +1444,7 @@ void HudElements::present_mode() {
} }
void HudElements::network() { void HudElements::network() {
#ifdef __linux__
if (HUDElements.net && HUDElements.net->should_reset) if (HUDElements.net && HUDElements.net->should_reset)
HUDElements.net.reset(new Net); HUDElements.net.reset(new Net);
@ -1474,6 +1475,7 @@ void HudElements::network() {
HUDElements.TextColored(HUDElements.colors.text, "KB/s"); HUDElements.TextColored(HUDElements.colors.text, "KB/s");
ImGui::PopFont(); ImGui::PopFont();
} }
#endif
} }
void HudElements::sort_elements(const std::pair<std::string, std::string>& option) { void HudElements::sort_elements(const std::pair<std::string, std::string>& option) {

@ -24,7 +24,7 @@ namespace fs = ghc::filesystem;
class Net { class Net {
public: public:
bool should_reset = false; bool should_reset = false;
struct interface { struct networkInterface {
std::string name; std::string name;
uint64_t txBytes; uint64_t txBytes;
uint64_t rxBytes; uint64_t rxBytes;
@ -35,7 +35,7 @@ class Net {
Net(); Net();
void update(); void update();
std::vector<interface> interfaces = {}; std::vector<networkInterface> interfaces = {};
private: private:
uint64_t calculateThroughput(long long currentBytes, long long previousBytes, uint64_t calculateThroughput(long long currentBytes, long long previousBytes,

@ -269,7 +269,9 @@ void update_hud_info_with_frametime(struct swapchain_stats& sw_stats, const stru
hw_update_thread->update(&params, vendorID); hw_update_thread->update(&params, vendorID);
if (fpsmetrics) fpsmetrics->update_thread(); if (fpsmetrics) fpsmetrics->update_thread();
#ifdef __linux__
if (HUDElements.net) HUDElements.net->update(); if (HUDElements.net) HUDElements.net->update();
#endif
sw_stats.fps = 1000000000.0 * sw_stats.n_frames_since_update / elapsed; sw_stats.fps = 1000000000.0 * sw_stats.n_frames_since_update / elapsed;

Loading…
Cancel
Save