group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
SettingsScreen Class Reference

IScreen wrapper around the shared tabbed settings editor. More...

#include <SettingsScreen.hpp>

Inheritance diagram for SettingsScreen:
[legend]
Collaboration diagram for SettingsScreen:
[legend]

Public Member Functions

bool init (AppContext &ctx)
 Bind app-owned dependencies and open the settings editor.
SDL_AppResult event (SDL_Event *event) override
 Handle an incoming SDL event.
SDL_AppResult iterate () override
 Update the screen state and render the next frame.
void quit () override
 Perform any necessary cleanup before the screen is destroyed.
bool consumeBackRequest ()
 True if the user requested returning to the previous screen, then clear that request.
Public Member Functions inherited from IScreen
virtual ~IScreen ()=default
virtual void shutdownAfterRenderer ()
 Perform cleanup that must happen after the App-owned renderer shuts down.

Private Attributes

NewRendererrenderer = nullptr
 Renderer; not owned.
SDL_Window * window = nullptr
 Application window; not owned.
UserSettingssettings = nullptr
 Live user settings; not owned.
std::string_view settingsPath
 Save path for user settings.
SettingsEditor editor
 Shared settings page implementation.
bool pendingBack = false
 Set when the page should close, cleared by App.

Additional Inherited Members

Static Protected Member Functions inherited from IScreen
static SDL_AppResult processCommonImguiEvent (SDL_Event *event)
 Forward event to ImGui and detect SDL_EVENT_QUIT.
static bool handleSystemMenuEvent (SDL_Event *event, SystemMenuOverlay &menu, UserSettings *settings)
 Handle Escape-toggle of a SystemMenuOverlay and forward consumed events.
static void beginMenuFrame (NewRenderer *renderer)
 Start a new ImGui frame and paint the shared menu background.
static void presentMenuFrame (NewRenderer &renderer)
 Render the ImGui draw data and present a default-camera frame.

Detailed Description

IScreen wrapper around the shared tabbed settings editor.

Member Function Documentation

◆ consumeBackRequest()

bool SettingsScreen::consumeBackRequest ( )

True if the user requested returning to the previous screen, then clear that request.

◆ event()

SDL_AppResult SettingsScreen::event ( SDL_Event * event)
overridevirtual

Handle an incoming SDL event.

Parameters
eventThe SDL event to process.
Returns
SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.

Implements IScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

bool SettingsScreen::init ( AppContext & ctx)

Bind app-owned dependencies and open the settings editor.

Here is the call graph for this function:

◆ iterate()

SDL_AppResult SettingsScreen::iterate ( )
overridevirtual

Update the screen state and render the next frame.

Returns
SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.

Implements IScreen.

Here is the call graph for this function:

◆ quit()

void SettingsScreen::quit ( )
overridevirtual

Perform any necessary cleanup before the screen is destroyed.

Implements IScreen.

Member Data Documentation

◆ editor

SettingsEditor SettingsScreen::editor
private

Shared settings page implementation.

◆ pendingBack

bool SettingsScreen::pendingBack = false
private

Set when the page should close, cleared by App.

◆ renderer

NewRenderer* SettingsScreen::renderer = nullptr
private

Renderer; not owned.

◆ settings

UserSettings* SettingsScreen::settings = nullptr
private

Live user settings; not owned.

◆ settingsPath

std::string_view SettingsScreen::settingsPath
private

Save path for user settings.

◆ window

SDL_Window* SettingsScreen::window = nullptr
private

Application window; not owned.


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