group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
TitleScreen.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "IScreen.hpp"
7#include "app/AppContext.hpp"
10
12class TitleScreen : public IScreen
13{
14public:
17 bool init(AppContext& ctx);
18
19 SDL_AppResult event(SDL_Event* event) override;
20 SDL_AppResult iterate() override;
21 void quit() override;
22
24 bool consumePlayRequest();
25
27 bool consumeHostRequest();
28
31
33 bool consumeExitRequest();
34
35private:
36 NewRenderer* renderer = nullptr;
37 SDL_Window* window = nullptr;
38 bool pendingPlay = false;
39 bool pendingHost = false;
40 bool pendingSettings = false;
41 bool pendingExit = false;
42};
Borrowed dependencies shared by client screens.
Abstract interface for top-level application screens (lobby, in-game).
Work-in-progress SDL3 GPU renderer.
ImGui widget for the top-level landing menu.
Interface implemented by each full-screen mode (Lobby, Game).
Definition IScreen.hpp:16
Graphics-team's work-in-progress SDL3 GPU renderer.
Definition NewRenderer.hpp:83
IScreen implementation for the first landing menu.
Definition TitleScreen.hpp:13
SDL_Window * window
Application window; not owned.
Definition TitleScreen.hpp:37
bool init(AppContext &ctx)
Bind renderer and window; must be called before iterate().
Definition TitleScreen.cpp:9
void quit() override
Perform any necessary cleanup before the screen is destroyed.
Definition TitleScreen.cpp:49
SDL_AppResult event(SDL_Event *event) override
Handle an incoming SDL event.
Definition TitleScreen.cpp:19
bool consumePlayRequest()
True if the user requested opening the main menu/join screen, then clear that request.
Definition TitleScreen.cpp:51
bool pendingHost
Set when the user clicks "Host", cleared by App.
Definition TitleScreen.hpp:39
bool consumeExitRequest()
True if the user requested closing the application, then clear that request.
Definition TitleScreen.cpp:78
NewRenderer * renderer
Renderer; not owned.
Definition TitleScreen.hpp:36
bool consumeSettingsRequest()
True if the user requested opening the settings screen, then clear that request.
Definition TitleScreen.cpp:69
bool pendingSettings
Set when the user clicks "Settings", cleared by App.
Definition TitleScreen.hpp:40
bool consumeHostRequest()
True if the user requested opening the host configuration screen, then clear that request.
Definition TitleScreen.cpp:60
bool pendingExit
Set when the user clicks "Exit", cleared by App.
Definition TitleScreen.hpp:41
bool pendingPlay
Set when the user clicks "Play", cleared by App.
Definition TitleScreen.hpp:38
SDL_AppResult iterate() override
Update the screen state and render the next frame.
Definition TitleScreen.cpp:24
Non-owning view of App-owned services and configuration.
Definition AppContext.hpp:20