-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuItem.h
executable file
·53 lines (48 loc) · 1023 Bytes
/
MenuItem.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
52
53
/*
* MenuItem.h
* teapots
*
* Created by Ben Wadsworth on 14/08/2011.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#ifndef MENUITEM_H
#define MENUITEM_H
#define RESPONSE_NULL 0
#define RESPONSE_OPEN_SUBMENU 1
#define RESPONSE_PLAY_1P 2
#define RESPONSE_PLAY_2P 3
#define RESPONSE_CONTROLS 4
#define RESPONSE_QUIT 5
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <OpenGL/OpenGL.h>
#include <GLUT/GLUT.h>
#include "drawText.h"
class MenuItem {
protected:
std::vector<MenuItem*> children;
std::string name;
float xsize, ysize;
int response;
bool focused;
std::string imageFile;
GLuint texture;
public:
MenuItem(std::string name);
void drawAt(float,float);
void setSize(float,float);
void setFocused(bool);
void addChild(MenuItem*);
void setResponse(int);
void setImage(std::string filename);
std::vector<MenuItem*> getChildren();
int getResponse();
bool getFocused();
float getXSize();
float getYSize();
std::string getName();
};
#endif