group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
IScreen Class Referenceabstract

Interface implemented by each full-screen mode (Lobby, Game). More...

#include <IScreen.hpp>

Inheritance diagram for IScreen:
[legend]

Public Member Functions

virtual ~IScreen ()=default
virtual SDL_AppResult event (SDL_Event *event)=0
 Handle an incoming SDL event.
virtual SDL_AppResult iterate ()=0
 Update the screen state and render the next frame.
virtual void quit ()=0
 Perform any necessary cleanup before the screen is destroyed.
virtual void shutdownAfterRenderer ()
 Perform cleanup that must happen after the App-owned renderer shuts down.

Static Protected Member Functions

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

Interface implemented by each full-screen mode (Lobby, Game).

App owns one active IScreen at a time and delegates SDL event processing, per-frame iteration, and shutdown to it.

Constructor & Destructor Documentation

◆ ~IScreen()

virtual IScreen::~IScreen ( )
virtualdefault

Member Function Documentation

◆ beginMenuFrame()

void IScreen::beginMenuFrame ( NewRenderer * renderer)
staticprotected

Start a new ImGui frame and paint the shared menu background.

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

◆ event()

virtual SDL_AppResult IScreen::event ( SDL_Event * event)
pure virtual

Handle an incoming SDL event.

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

Implemented in Game, HostConfig, LoadingScreen, Lobby, MainMenu, PostMatchScoreboard, SettingsScreen, and TitleScreen.

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

◆ handleSystemMenuEvent()

bool IScreen::handleSystemMenuEvent ( SDL_Event * event,
SystemMenuOverlay & menu,
UserSettings * settings )
staticprotected

Handle Escape-toggle of a SystemMenuOverlay and forward consumed events.

Returns
true if the overlay handled the event and the caller should return SDL_APP_CONTINUE without further processing.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ iterate()

virtual SDL_AppResult IScreen::iterate ( )
pure virtual

Update the screen state and render the next frame.

Returns
SDL_APP_CONTINUE to keep running, SDL_APP_FAILURE to exit.

Implemented in Game, HostConfig, LoadingScreen, Lobby, MainMenu, PostMatchScoreboard, SettingsScreen, and TitleScreen.

◆ presentMenuFrame()

void IScreen::presentMenuFrame ( NewRenderer & renderer)
staticprotected

Render the ImGui draw data and present a default-camera frame.

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

◆ processCommonImguiEvent()

SDL_AppResult IScreen::processCommonImguiEvent ( SDL_Event * event)
staticprotected

Forward event to ImGui and detect SDL_EVENT_QUIT.

Returns
SDL_APP_SUCCESS on quit; SDL_APP_CONTINUE otherwise. Callers should early-return when the result is not SDL_APP_CONTINUE.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quit()

virtual void IScreen::quit ( )
pure virtual

Perform any necessary cleanup before the screen is destroyed.

Implemented in Game, HostConfig, LoadingScreen, Lobby, MainMenu, PostMatchScoreboard, SettingsScreen, and TitleScreen.

◆ shutdownAfterRenderer()

virtual void IScreen::shutdownAfterRenderer ( )
inlinevirtual

Perform cleanup that must happen after the App-owned renderer shuts down.

Reimplemented in Game.


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