group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
IScreen.hpp
Go to the documentation of this file.
1
3
4#pragma once
5#include <SDL3/SDL.h>
6
7class NewRenderer;
9struct UserSettings;
10
16{
17public:
18 virtual ~IScreen() = default;
19
23 virtual SDL_AppResult event(SDL_Event* event) = 0;
24
27 virtual SDL_AppResult iterate() = 0;
28
30 virtual void quit() = 0;
31
33 virtual void shutdownAfterRenderer() {}
34
35protected:
39 static SDL_AppResult processCommonImguiEvent(SDL_Event* event);
40
44 static bool handleSystemMenuEvent(SDL_Event* event, SystemMenuOverlay& menu, UserSettings* settings);
45
47 static void beginMenuFrame(NewRenderer* renderer);
48
50 static void presentMenuFrame(NewRenderer& renderer);
51};
Interface implemented by each full-screen mode (Lobby, Game).
Definition IScreen.hpp:16
virtual SDL_AppResult iterate()=0
Update the screen state and render the next frame.
static void presentMenuFrame(NewRenderer &renderer)
Render the ImGui draw data and present a default-camera frame.
Definition IScreen.cpp:48
virtual SDL_AppResult event(SDL_Event *event)=0
Handle an incoming SDL event.
virtual void quit()=0
Perform any necessary cleanup before the screen is destroyed.
static void beginMenuFrame(NewRenderer *renderer)
Start a new ImGui frame and paint the shared menu background.
Definition IScreen.cpp:40
virtual void shutdownAfterRenderer()
Perform cleanup that must happen after the App-owned renderer shuts down.
Definition IScreen.hpp:33
static bool handleSystemMenuEvent(SDL_Event *event, SystemMenuOverlay &menu, UserSettings *settings)
Handle Escape-toggle of a SystemMenuOverlay and forward consumed events.
Definition IScreen.cpp:25
static SDL_AppResult processCommonImguiEvent(SDL_Event *event)
Forward event to ImGui and detect SDL_EVENT_QUIT.
Definition IScreen.cpp:17
virtual ~IScreen()=default
Graphics-team's work-in-progress SDL3 GPU renderer.
Definition NewRenderer.hpp:83
Shared Escape menu for non-gameplay screens.
Definition SystemMenuOverlay.hpp:20
Per-user gameplay settings loaded from SDL's pref-path TOML file.
Definition UserSettings.hpp:25