added buttons to main state

This commit is contained in:
2025-11-22 12:16:47 +01:00
parent 838b5b1836
commit 4e69ed9742
12 changed files with 644 additions and 60 deletions

View File

@ -3,6 +3,8 @@
#include <SDL3/SDL.h>
#include <memory>
#include <vector>
#include <functional>
#include <string>
// Forward declarations for frequently used types
class Game;
@ -48,6 +50,11 @@ struct StateContext {
bool* showSettingsPopup = nullptr;
bool* showExitConfirmPopup = nullptr; // If true, show "Exit game?" confirmation while playing
int* exitPopupSelectedButton = nullptr; // 0 = YES, 1 = NO (default)
std::string* playerName = nullptr; // Shared player name buffer for highscores/options
bool* fullscreenFlag = nullptr; // Tracks current fullscreen state when available
std::function<void(bool)> applyFullscreen; // Allows states to request fullscreen changes
std::function<bool()> queryFullscreen; // Optional callback if fullscreenFlag is not reliable
std::function<void()> requestQuit; // Allows menu/option states to close the app gracefully
// Pointer to the application's StateManager so states can request transitions
StateManager* stateManager = nullptr;
};