|
MetaImGUI 1.0.0
ImGui Application Template for C++20
|
Handles all ImGui rendering operations. More...
#include <UIRenderer.h>
Public Member Functions | |
| UIRenderer () | |
| ~UIRenderer () | |
| UIRenderer (const UIRenderer &)=delete | |
| UIRenderer & | operator= (const UIRenderer &)=delete |
| UIRenderer (UIRenderer &&)=delete | |
| UIRenderer & | operator= (UIRenderer &&)=delete |
| bool | Initialize (GLFWwindow *window) |
| Initialize ImGui context and backends. | |
| void | Shutdown () |
| Shutdown ImGui context. | |
| void | BeginFrame () |
| Begin a new ImGui frame. | |
| void | EndFrame () |
| End the current ImGui frame and render. | |
| void | RenderMainWindow (std::function< void()> onShowAbout, std::function< void()> onShowDemo, std::function< void()> onShowInputDialog=nullptr) |
| Render the main application window. | |
| 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. | |
| void | RenderStatusBar (const std::string &statusMessage, float fps, const char *version, bool updateInProgress) |
| Render the status bar. | |
| void | RenderAboutWindow (bool &showAboutWindow) |
| Render the about dialog. | |
| void | RenderUpdateNotification (bool &showUpdateNotification, UpdateInfo *updateInfo) |
| Render the update notification dialog. | |
| void | ShowDemoWindow (bool &showDemoWindow) |
| Show ImGui demo window. | |
| void | RenderISSTrackerWindow (bool &showISSTracker, ISSTracker *issTracker) |
| Render the ISS tracker window. | |
Static Public Member Functions | |
| static void | HelpMarker (const char *desc) |
| Helper to show tooltip with question mark. | |
Handles all ImGui rendering operations.
UIRenderer encapsulates all ImGui-specific rendering logic, keeping the Application class focused on high-level orchestration and state management.
Definition at line 40 of file UIRenderer.h.
|
default |
| MetaImGUI::UIRenderer::~UIRenderer | ( | ) |
Definition at line 78 of file UIRenderer.cpp.
References Shutdown().
|
delete |
|
delete |
| void MetaImGUI::UIRenderer::BeginFrame | ( | ) |
Begin a new ImGui frame.
Definition at line 117 of file UIRenderer.cpp.
| void MetaImGUI::UIRenderer::EndFrame | ( | ) |
End the current ImGui frame and render.
Definition at line 123 of file UIRenderer.cpp.
|
static |
Helper to show tooltip with question mark.
| desc | Tooltip description text |
Definition at line 637 of file UIRenderer.cpp.
References MetaImGUI::UILayout::TEXT_WRAP_POS_MULTIPLIER.
| bool MetaImGUI::UIRenderer::Initialize | ( | GLFWwindow * | window | ) |
Initialize ImGui context and backends.
| window | GLFW window pointer |
Definition at line 82 of file UIRenderer.cpp.
References MetaImGUI::ThemeManager::Apply(), and MetaImGUI::ThemeManager::Modern.
|
delete |
|
delete |
| void MetaImGUI::UIRenderer::RenderAboutWindow | ( | bool & | showAboutWindow | ) |
Render the about dialog.
| showAboutWindow | Reference to visibility flag |
Definition at line 325 of file UIRenderer.cpp.
References MetaImGUI::UILayout::ABOUT_WINDOW_HEIGHT, MetaImGUI::UILayout::ABOUT_WINDOW_WIDTH, MetaImGUI::Localization::Instance(), and MetaImGUI::UILayout::VERTICAL_SPACING_SMALL.
| void MetaImGUI::UIRenderer::RenderISSTrackerWindow | ( | bool & | showISSTracker, |
| ISSTracker * | issTracker | ||
| ) |
Render the ISS tracker window.
| showISSTracker | Reference to visibility flag |
| issTracker | Pointer to ISSTracker instance |
Definition at line 517 of file UIRenderer.cpp.
References MetaImGUI::ISSPosition::altitude, MetaImGUI::ISSTracker::GetCurrentPosition(), MetaImGUI::ISSTracker::GetPositionHistory(), MetaImGUI::ISSTracker::IsTracking(), MetaImGUI::ISSPosition::latitude, MetaImGUI::ISSPosition::longitude, MetaImGUI::ISSTracker::StartTracking(), MetaImGUI::ISSTracker::StopTracking(), MetaImGUI::ISSPosition::timestamp, MetaImGUI::ISSPosition::valid, and MetaImGUI::ISSPosition::velocity.
| void MetaImGUI::UIRenderer::RenderMainWindow | ( | std::function< void()> | onShowAbout, |
| std::function< void()> | onShowDemo, | ||
| std::function< void()> | onShowInputDialog = nullptr |
||
| ) |
Render the main application window.
| onShowAbout | Callback when "Show About" is clicked |
| onShowDemo | Callback when "Show Demo" is clicked |
| onShowInputDialog | Callback when "Show Input Dialog" is clicked |
Definition at line 128 of file UIRenderer.cpp.
References MetaImGUI::UILayout::BUTTON_SPACING, MetaImGUI::Localization::Instance(), MetaImGUI::UILayout::LEFT_MARGIN, MetaImGUI::UILayout::LINE_SPACING, MetaImGUI::UILayout::STATUS_BAR_HEIGHT, and MetaImGUI::UILayout::TOP_MARGIN.
| void MetaImGUI::UIRenderer::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.
| onExit | Callback when exit is requested |
| onToggleDemo | Callback when demo window is toggled |
| onCheckUpdates | Callback when update check is requested |
| onShowAbout | Callback when about is requested |
| showDemoWindow | Current state of demo window visibility |
| onToggleISSTracker | Callback when ISS tracker is toggled |
| showISSTracker | Current state of ISS tracker window visibility |
Definition at line 173 of file UIRenderer.cpp.
References MetaImGUI::ThemeManager::Apply(), MetaImGUI::ThemeManager::Classic, MetaImGUI::ThemeManager::Dark, MetaImGUI::ThemeManager::GetCurrent(), MetaImGUI::Localization::Instance(), MetaImGUI::ThemeManager::Light, and MetaImGUI::ThemeManager::Modern.
| void MetaImGUI::UIRenderer::RenderStatusBar | ( | const std::string & | statusMessage, |
| float | fps, | ||
| const char * | version, | ||
| bool | updateInProgress | ||
| ) |
Render the status bar.
| statusMessage | Status message to display |
| fps | Current FPS |
| version | Version string |
| updateInProgress | Whether an update check is in progress |
Definition at line 258 of file UIRenderer.cpp.
References MetaImGUI::UILayout::ITEM_SPACING_X, MetaImGUI::UILayout::ITEM_SPACING_Y, MetaImGUI::UILayout::STATUS_BAR_HEIGHT, MetaImGUI::UILayout::STATUS_CIRCLE_PADDING, MetaImGUI::UILayout::STATUS_CIRCLE_RADIUS, MetaImGUI::UILayout::STATUS_RIGHT_SIDE_WIDTH, MetaImGUI::UILayout::WINDOW_PADDING_X, and MetaImGUI::UILayout::WINDOW_PADDING_Y.
| void MetaImGUI::UIRenderer::RenderUpdateNotification | ( | bool & | showUpdateNotification, |
| UpdateInfo * | updateInfo | ||
| ) |
Render the update notification dialog.
| showUpdateNotification | Reference to visibility flag |
| updateInfo | Pointer to update information |
Definition at line 372 of file UIRenderer.cpp.
References MetaImGUI::UILayout::BUTTON_CLOSE_WIDTH, MetaImGUI::UILayout::BUTTON_HEIGHT, MetaImGUI::UILayout::BUTTON_OPEN_RELEASE_WIDTH, MetaImGUI::UILayout::BUTTON_REMIND_LATER_WIDTH, MetaImGUI::UpdateInfo::currentVersion, MetaImGUI::UpdateInfo::latestVersion, LOG_ERROR, MetaImGUI::UILayout::RELEASE_NOTES_HEIGHT, MetaImGUI::UpdateInfo::releaseNotes, MetaImGUI::UpdateInfo::releaseUrl, MetaImGUI::UILayout::UPDATE_WINDOW_HEIGHT, MetaImGUI::UILayout::UPDATE_WINDOW_WIDTH, and MetaImGUI::UpdateInfo::updateAvailable.
| void MetaImGUI::UIRenderer::ShowDemoWindow | ( | bool & | showDemoWindow | ) |
Show ImGui demo window.
| showDemoWindow | Reference to visibility flag |
Definition at line 511 of file UIRenderer.cpp.
| void MetaImGUI::UIRenderer::Shutdown | ( | ) |