initial commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "page.h"
|
||||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Settings : public Page {
|
||||
public:
|
||||
void onPush(AppState& state) override;
|
||||
void onResume(AppState& state) override;
|
||||
void onPause(AppState& state) override;
|
||||
void onPop(AppState& state) override;
|
||||
void handleEvent(const SDL_Event& event) override;
|
||||
void update(float dt) override;
|
||||
void render(SDL_Renderer* renderer) override;
|
||||
|
||||
private:
|
||||
struct MenuItem {
|
||||
std::string label;
|
||||
SDL_Texture* texture = nullptr;
|
||||
float width = 0;
|
||||
float height = 0;
|
||||
float y = 0;
|
||||
};
|
||||
|
||||
void createTextures(AppState& state);
|
||||
void destroyTextures();
|
||||
|
||||
AppState* state_ = nullptr;
|
||||
int selectedItem_ = 0;
|
||||
std::vector<MenuItem> items_;
|
||||
|
||||
SDL_Texture* bgTexture_ = nullptr;
|
||||
float bgWidth_ = 0;
|
||||
float bgHeight_ = 0;
|
||||
|
||||
SDL_Texture* titleTexture_ = nullptr;
|
||||
float titleWidth_ = 0;
|
||||
float titleHeight_ = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user