Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
network_stats.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
6 
17 {
18 public:
19  void Draw()
20  {
21  // shows all network info too be noted..
22  if (!show)
23  {
24  return;
25  }
26 
27  ImGui::Begin("Network Stats", &show);
28 
29  ImVec4 statusColor;
30 
32  {
33  statusColor = ImColor(0, 255, 0);
34  }
35  else
36  {
37  statusColor = ImColor(255, 0, 0);
38  }
39 
40  ImGui::Text("Status:");
42  ImGui::TextColored(statusColor, Blam::Network::IsConnected() ? "Connected!" : "Disconnected!");
43  ImGui::Text("Host: localhost");
44  ImGui::Text("Ping: 0ms");
45 
46  ImGui::End();
47  }
48 };
BlamImGuiWindow::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: imgui.h:34
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
BlamImGuiWindow
Class representing an ImGUI window.
Definition: imgui.h:31
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
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
BlamImGuiWindow_NetworkStats::Draw
void Draw()
Draws the contents of the group.
Definition: network_stats.hpp:19
BlamImGuiWindow_NetworkStats
Class for the Network Stats dialog.
Definition: network_stats.hpp:16
imgui.h
socket.h
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