MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
UIRenderer.h
Go to the documentation of this file.
1/*
2 MetaImGUI
3 Copyright (C) 2026 A P Nicholson
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21#include <functional>
22#include <memory>
23#include <string>
24
25// Forward declarations
26struct GLFWwindow;
27
28namespace MetaImGUI {
29
30// Forward declarations
31struct UpdateInfo;
32class ISSTracker;
33
41public:
44
45 // Disable copy and move
46 UIRenderer(const UIRenderer&) = delete;
47 UIRenderer& operator=(const UIRenderer&) = delete;
50
56 bool Initialize(GLFWwindow* window);
57
61 void Shutdown();
62
66 void BeginFrame();
67
71 void EndFrame();
72
79 void RenderMainWindow(std::function<void()> onShowAbout, std::function<void()> onShowDemo,
80 std::function<void()> onShowInputDialog = nullptr);
81
92 void RenderMenuBar(std::function<void()> onExit, std::function<void()> onToggleDemo,
93 std::function<void()> onCheckUpdates, std::function<void()> onShowAbout, bool showDemoWindow,
94 std::function<void()> onToggleISSTracker = nullptr, bool showISSTracker = false);
95
103 void RenderStatusBar(const std::string& statusMessage, float fps, const char* version, bool updateInProgress);
104
109 void RenderAboutWindow(bool& showAboutWindow);
110
116 void RenderUpdateNotification(bool& showUpdateNotification, UpdateInfo* updateInfo);
117
122 void ShowDemoWindow(bool& showDemoWindow);
123
129 void RenderISSTrackerWindow(bool& showISSTracker, ISSTracker* issTracker);
130
135 static void HelpMarker(const char* desc);
136
137private:
138 bool m_initialized = false;
139};
140
141} // namespace MetaImGUI
ISS Tracker that fetches ISS position data asynchronously.
Definition ISSTracker.h:51
Handles all ImGui rendering operations.
Definition UIRenderer.h:40
void ShowDemoWindow(bool &showDemoWindow)
Show ImGui demo window.
void RenderUpdateNotification(bool &showUpdateNotification, UpdateInfo *updateInfo)
Render the update notification dialog.
void RenderAboutWindow(bool &showAboutWindow)
Render the about dialog.
void RenderMainWindow(std::function< void()> onShowAbout, std::function< void()> onShowDemo, std::function< void()> onShowInputDialog=nullptr)
Render the main application window.
UIRenderer(const UIRenderer &)=delete
void RenderStatusBar(const std::string &statusMessage, float fps, const char *version, bool updateInProgress)
Render the status bar.
UIRenderer & operator=(UIRenderer &&)=delete
UIRenderer & operator=(const UIRenderer &)=delete
void Shutdown()
Shutdown ImGui context.
void RenderMenuBar(std::function< void()> onExit, std::function< void()> onToggleDemo, std::function< void()> onCheckUpdates, std::function< void()> onShowAbout, bool showDemoWindow, std::function< void()> onToggleISSTracker=nullptr, bool showISSTracker=false)
Render the menu bar.
UIRenderer(UIRenderer &&)=delete
void BeginFrame()
Begin a new ImGui frame.
static void HelpMarker(const char *desc)
Helper to show tooltip with question mark.
void RenderISSTrackerWindow(bool &showISSTracker, ISSTracker *issTracker)
Render the ISS tracker window.
bool Initialize(GLFWwindow *window)
Initialize ImGui context and backends.
void EndFrame()
End the current ImGui frame and render.