fade effect when switching states

This commit is contained in:
2025-11-29 19:23:41 +01:00
parent a7d67b26a5
commit 332e2efb74
5 changed files with 71 additions and 21 deletions

View File

@ -13,6 +13,7 @@ class Starfield;
class Starfield3D;
class FontAtlas;
class LineEffect;
enum class AppState;
// Forward declare StateManager so StateContext can hold a pointer without
// including the StateManager header here.
@ -58,6 +59,7 @@ struct StateContext {
std::function<bool()> queryFullscreen; // Optional callback if fullscreenFlag is not reliable
std::function<void()> requestQuit; // Allows menu/option states to close the app gracefully
std::function<void()> startPlayTransition; // Optional fade hook when transitioning from menu to gameplay
std::function<void(AppState)> requestFadeTransition; // Generic state fade requests (menu/options/level)
// Pointer to the application's StateManager so states can request transitions
StateManager* stateManager = nullptr;
};