Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
network_stats.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../debug_ui.h"
4 
6 
8 {
18  {
19  public:
22 
23  void Draw()
24  {
25  // shows all network info too be noted..
26  if (show)
27  {
28  ImGui::Begin("Network Stats", &show);
29 
30  ImVec4 statusColor;
31 
33  {
34  statusColor = ImColor(0, 255, 0);
35  }
36  else
37  {
38  statusColor = ImColor(255, 0, 0);
39  }
40 
41  ImGui::Text("Status:");
43  ImGui::TextColored(statusColor, Blam::Network::IsConnected() ? "Connected!" : "Disconnected!");
44  ImGui::Text("Host: localhost");
45  ImGui::Text("Ping: 0ms");
46 
47  ImGui::End();
48  }
49 
50  }
51  };
52 }
Blam::DebugUI::Windows::NetworkStats::~NetworkStats
~NetworkStats()
Definition: network_stats.hpp:21
ImVec4
Definition: imgui.h:192
ImGui::End
IMGUI_API void End()
Definition: imgui.cpp:6016
ImGui::SameLine
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
Blam::Network::IsConnected
BLAM bool IsConnected()
Definition: socket.cpp:380
ImGui::Begin
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:5397
Blam::DebugUI::Windows::NetworkStats
Class for the Network Stats dialog.
Definition: network_stats.hpp:17
Blam::DebugUI::Windows::NetworkStats::Draw
void Draw()
Draws the contents of the group.
Definition: network_stats.hpp:23
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
Blam::DebugUI::ImGUIDrawingGroup::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: debug_ui.h:362
Blam::DebugUI::Windows::NetworkStats::NetworkStats
NetworkStats()
Definition: network_stats.hpp:20
Blam::DebugUI::ImGUIDrawingGroup
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:359
socket.h
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: ui.h:26
ImColor
Definition: imgui.h:1749
ImGui::TextColored
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
Definition: imgui_widgets.cpp:257