BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
UIManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <memory>
5
6// Forward declarations
7struct GLFWwindow;
8struct ImGuiContext;
9
10namespace client_ui {
11
16class UIManager {
17public:
18 UIManager();
19 ~UIManager();
20
28 bool start(const std::string& title, int width, int height);
29
33 void stop();
34
38 bool shouldClose() const;
39
43 void beginFrame();
44
48 void endFrame();
49
53 void renderDockspace();
54
55 GLFWwindow* getWindow() const { return mWindow; }
56
57private:
58 GLFWwindow* mWindow = nullptr;
59 ImGuiContext* mImGuiContext = nullptr;
60};
61
62} // namespace client_ui
Manages the lifecycle of the GLFW window and ImGui context.
Definition UIManager.h:16
void beginFrame()
Prepares for a new frame (polls events, starts ImGui frame).
Definition UIManager.cpp:90
bool shouldClose() const
Checks if the window should close (e.g., user clicked X).
Definition UIManager.cpp:86
ImGuiContext * mImGuiContext
Definition UIManager.h:59
GLFWwindow * getWindow() const
Definition UIManager.h:55
bool start(const std::string &title, int width, int height)
Initializes GLFW, creates the window, and sets up ImGui.
Definition UIManager.cpp:25
void renderDockspace()
Renders the master dockspace that fills the entire window.
Definition UIManager.cpp:118
GLFWwindow * mWindow
Definition UIManager.h:58
~UIManager()
Definition UIManager.cpp:21
void endFrame()
Finalizes the frame (renders ImGui, swaps buffers).
Definition UIManager.cpp:98
void stop()
Shuts down ImGui and GLFW, destroying the window.
Definition UIManager.cpp:70
UIManager()
Definition UIManager.cpp:19
Definition ChartPanel.h:8