Initial release: SDL Windows Tetris

This commit is contained in:
2025-08-15 11:01:48 +02:00
commit d161b2c550
196 changed files with 5944 additions and 0 deletions

33
src/states/MenuState.cpp Normal file
View File

@ -0,0 +1,33 @@
// MenuState.cpp
#include "MenuState.h"
#include "../Scores.h"
#include "../Font.h"
#include <SDL3/SDL.h>
#include <cstdio>
MenuState::MenuState(StateContext& ctx) : State(ctx) {}
void MenuState::onEnter() {
// nothing for now
}
void MenuState::onExit() {
}
void MenuState::handleEvent(const SDL_Event& e) {
// Menu-specific key handling moved from main; main still handles mouse for now
if (e.type == SDL_EVENT_KEY_DOWN && !e.key.repeat) {
if (ctx.startLevelSelection && *ctx.startLevelSelection >= 0) {
// keep simple: allow L/S toggles handled globally in main for now
}
}
}
void MenuState::update(double frameMs) {
(void)frameMs;
}
void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logicalVP) {
(void)renderer; (void)logicalScale; (void)logicalVP;
// Main still performs actual rendering for now; this placeholder keeps the API.
}