group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
LoadingScreen.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "IScreen.hpp"
7#include "app/AppContext.hpp"
9
10#include <SDL3/SDL.h>
11
12#include <string>
13
15class LoadingScreen : public IScreen
16{
17public:
19 bool init(AppContext& ctx);
20
21 SDL_AppResult event(SDL_Event* event) override;
22 SDL_AppResult iterate() override;
23 void quit() override;
24
26 bool readyToStartGame() const;
27
28private:
29 NewRenderer* renderer = nullptr;
30 SDL_Window* window = nullptr;
31 std::string serverName;
32 bool renderedFrame = false;
33};
Borrowed dependencies shared by client screens.
Abstract interface for top-level application screens (lobby, in-game).
Work-in-progress SDL3 GPU renderer.
Interface implemented by each full-screen mode (Lobby, Game).
Definition IScreen.hpp:16
Front-end screen displayed while the client is about to enter gameplay.
Definition LoadingScreen.hpp:16
bool readyToStartGame() const
True after at least one loading frame has been submitted.
Definition LoadingScreen.cpp:60
SDL_AppResult event(SDL_Event *event) override
Handle an incoming SDL event.
Definition LoadingScreen.cpp:23
bool init(AppContext &ctx)
Bind borrowed app resources and capture display metadata.
Definition LoadingScreen.cpp:12
void quit() override
Perform any necessary cleanup before the screen is destroyed.
Definition LoadingScreen.cpp:58
std::string serverName
Display name for the connected server.
Definition LoadingScreen.hpp:31
bool renderedFrame
Set once iterate() has submitted one frame.
Definition LoadingScreen.hpp:32
SDL_AppResult iterate() override
Update the screen state and render the next frame.
Definition LoadingScreen.cpp:28
SDL_Window * window
Application window; not owned.
Definition LoadingScreen.hpp:30
NewRenderer * renderer
Shared renderer; not owned.
Definition LoadingScreen.hpp:29
Graphics-team's work-in-progress SDL3 GPU renderer.
Definition NewRenderer.hpp:83
Non-owning view of App-owned services and configuration.
Definition AppContext.hpp:20