MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
MetaImGUI::UIRenderer Class Reference

Handles all ImGui rendering operations. More...

#include <UIRenderer.h>

Public Member Functions

 UIRenderer ()
 
 ~UIRenderer ()
 
 UIRenderer (const UIRenderer &)=delete
 
UIRendereroperator= (const UIRenderer &)=delete
 
 UIRenderer (UIRenderer &&)=delete
 
UIRendereroperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UIRenderer() [1/3]

MetaImGUI::UIRenderer::UIRenderer ( )
default

◆ ~UIRenderer()

MetaImGUI::UIRenderer::~UIRenderer ( )

Definition at line 78 of file UIRenderer.cpp.

References Shutdown().

◆ UIRenderer() [2/3]

MetaImGUI::UIRenderer::UIRenderer ( const UIRenderer )
delete

◆ UIRenderer() [3/3]

MetaImGUI::UIRenderer::UIRenderer ( UIRenderer &&  )
delete

Member Function Documentation

◆ BeginFrame()

void MetaImGUI::UIRenderer::BeginFrame ( )

Begin a new ImGui frame.

Definition at line 117 of file UIRenderer.cpp.

◆ EndFrame()

void MetaImGUI::UIRenderer::EndFrame ( )

End the current ImGui frame and render.

Definition at line 123 of file UIRenderer.cpp.

◆ HelpMarker()

void MetaImGUI::UIRenderer::HelpMarker ( const char *  desc)
static

Helper to show tooltip with question mark.

Parameters
descTooltip description text

Definition at line 637 of file UIRenderer.cpp.

References MetaImGUI::UILayout::TEXT_WRAP_POS_MULTIPLIER.

◆ Initialize()

bool MetaImGUI::UIRenderer::Initialize ( GLFWwindow *  window)

Initialize ImGui context and backends.

Parameters
windowGLFW window pointer
Returns
true if initialization succeeded

Definition at line 82 of file UIRenderer.cpp.

References MetaImGUI::ThemeManager::Apply(), and MetaImGUI::ThemeManager::Modern.

◆ operator=() [1/2]

UIRenderer & MetaImGUI::UIRenderer::operator= ( const UIRenderer )
delete

◆ operator=() [2/2]

UIRenderer & MetaImGUI::UIRenderer::operator= ( UIRenderer &&  )
delete

◆ RenderAboutWindow()

void MetaImGUI::UIRenderer::RenderAboutWindow ( bool &  showAboutWindow)

Render the about dialog.

Parameters
showAboutWindowReference 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.

◆ RenderISSTrackerWindow()

◆ RenderMainWindow()

void MetaImGUI::UIRenderer::RenderMainWindow ( std::function< void()>  onShowAbout,
std::function< void()>  onShowDemo,
std::function< void()>  onShowInputDialog = nullptr 
)

Render the main application window.

Parameters
onShowAboutCallback when "Show About" is clicked
onShowDemoCallback when "Show Demo" is clicked
onShowInputDialogCallback 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.

◆ RenderMenuBar()

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.

Parameters
onExitCallback when exit is requested
onToggleDemoCallback when demo window is toggled
onCheckUpdatesCallback when update check is requested
onShowAboutCallback when about is requested
showDemoWindowCurrent state of demo window visibility
onToggleISSTrackerCallback when ISS tracker is toggled
showISSTrackerCurrent 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.

◆ RenderStatusBar()

void MetaImGUI::UIRenderer::RenderStatusBar ( const std::string &  statusMessage,
float  fps,
const char *  version,
bool  updateInProgress 
)

Render the status bar.

Parameters
statusMessageStatus message to display
fpsCurrent FPS
versionVersion string
updateInProgressWhether 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.

◆ RenderUpdateNotification()

◆ ShowDemoWindow()

void MetaImGUI::UIRenderer::ShowDemoWindow ( bool &  showDemoWindow)

Show ImGui demo window.

Parameters
showDemoWindowReference to visibility flag

Definition at line 511 of file UIRenderer.cpp.

◆ Shutdown()

void MetaImGUI::UIRenderer::Shutdown ( )

Shutdown ImGui context.

Definition at line 107 of file UIRenderer.cpp.

Referenced by ~UIRenderer().


The documentation for this class was generated from the following files: