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

Front-end screen displayed while the client is about to enter gameplay. More...

#include <LoadingScreen.hpp>

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

Public Member Functions

bool init (AppContext &ctx)
 Bind borrowed app resources and capture display metadata.
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 readyToStartGame () const
 True after at least one loading frame has been submitted.
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
 Shared renderer; not owned.
SDL_Window * window = nullptr
 Application window; not owned.
std::string serverName
 Display name for the connected server.
bool renderedFrame = false
 Set once iterate() has submitted one frame.

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

Front-end screen displayed while the client is about to enter gameplay.

Member Function Documentation

◆ event()

SDL_AppResult LoadingScreen::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 LoadingScreen::init ( AppContext & ctx)

Bind borrowed app resources and capture display metadata.

Here is the call graph for this function:

◆ iterate()

SDL_AppResult LoadingScreen::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 LoadingScreen::quit ( )
overridevirtual

Perform any necessary cleanup before the screen is destroyed.

Implements IScreen.

◆ readyToStartGame()

bool LoadingScreen::readyToStartGame ( ) const

True after at least one loading frame has been submitted.

Member Data Documentation

◆ renderedFrame

bool LoadingScreen::renderedFrame = false
private

Set once iterate() has submitted one frame.

◆ renderer

NewRenderer* LoadingScreen::renderer = nullptr
private

Shared renderer; not owned.

◆ serverName

std::string LoadingScreen::serverName
private

Display name for the connected server.

◆ window

SDL_Window* LoadingScreen::window = nullptr
private

Application window; not owned.


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