Initial release: SDL Windows Tetris
This commit is contained in:
33
src/states/MenuState.cpp
Normal file
33
src/states/MenuState.cpp
Normal 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.
|
||||
}
|
||||
Reference in New Issue
Block a user