-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.cpp
More file actions
56 lines (44 loc) · 1.45 KB
/
program.cpp
File metadata and controls
56 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <GUI/ImWindow/ImWindow.h>
extern void Render(ImWindow window);
int main()
{
ImWindow window{};
if (window.Initialize())
{
window.Run([&]() { Render(window); });
window.Close();
}
}
void Render(ImWindow window)
{
// Header
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 12.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f);
ImGui::PushStyleColor(ImGuiCol_WindowBg, IM_COL32(20, 20, 20, 220));
ImGui::TextColored(ImVec4(0.3f, 0.8f, 1.0f, 1.0f), "ImGui Overlay Example");
ImGui::Separator();
// Left panel
ImGui::BeginChild("LeftPanel", ImVec2(200, 0), true);
ImGui::Text("Navigation");
ImGui::Separator();
if (ImGui::Button("Dashboard", ImVec2(-1, 30))) {}
if (ImGui::Button("Settings", ImVec2(-1, 30))) {}
if (ImGui::Button("About", ImVec2(-1, 30))) {}
ImGui::EndChild();
ImGui::SameLine();
// Right panel (main content)
ImGui::BeginChild("MainContent", ImVec2(0, 0), true);
ImGui::Text("Welcome back!");
ImGui::Separator();
ImGui::Text("Stats:");
ImGui::ProgressBar(0.65f, ImVec2(-1, 0), "Progress 65%");
ImGui::ProgressBar(0.35f, ImVec2(-1, 0), "Progress 35%");
ImGui::Dummy(ImVec2(0, 15));
if (ImGui::Button("Click Me!", ImVec2(150, 40))) {
// do action
}
ImGui::EndChild();
ImGui::PopStyleColor();
ImGui::PopStyleVar(2);
}