-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.h
51 lines (38 loc) · 892 Bytes
/
Menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef MENU_H_INCLUDED
#define MENU_H_INCLUDED
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <vector>
#include "Texture.h"
enum MenuOption
{
MENU_PLAY = 0,
MENU_SCORE,
MENU_QUIT
};
enum MoveDirection
{
MOVE_UP,
MOVE_DOWN,
MOVE_LEFT,
MOVE_RIGHT
};
/* Main menu of options displayed during the title game state */
class Menu
{
private:
static const int lineSpacing = 40;
int currentOption;
Texture arrowTexture;
TTF_Font* menuFont;
std::vector<Texture> textTextures;
public:
Menu();
~Menu();
void LoadTextures( SDL_Renderer* renderer );
void ChangeOption( int moveDirection );
void Render( SDL_Renderer* renderer, int x, int y );
bool TexturesLoaded() { return !textTextures.empty() && arrowTexture.IsLoaded(); };
int GetCurrentOption() { return currentOption; };
};
#endif // MENU_H_INCLUDED