-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button.h
68 lines (63 loc) · 1.95 KB
/
Button.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* @author: Luis C. Isaula (lisaula)
*
* GNU GENERAL PUBLIC LICENSE Version 2
* The licenses for most software are designed to take away your
* freedom to share and change it. By contrast, the GNU General Public
* License is intended to guarantee your freedom to share and change free
* software--to make sure the software is free for all its users. This
* General Public License applies to most of the Free Software
* Foundation's software and to any other program whose authors commit to
* using it.
*/
#ifndef BUTTON_H
#define BUTTON_H
#include <GL/freeglut.h>
#include <GL/gl.h>
#include <stdio.h>
#include "Rosalila/system.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string>
#include<iostream>
using namespace std;
//SDL
#include "SDL2/SDL.h"
#include "Rosalila/RosalilaUtility/RosalilaUtility.h"
#include "Rosalila/RosalilaInputs/RosalilaInputs.h"
#include "Rosalila/RosalilaGraphics/RosalilaGraphics.h"
#include "Rosalila/RosalilaSound/RosalilaSound.h"
class Button
{
public:
RosalilaGraphics* painter;
// Receiver *receiver;
Image* img_up;
Image* img_dwn;
SDL_Rect rect_img;
bool clickLeft;
int mouse_x;
int mouse_y;
int x;
int y;
float xMinima; // Estos atributos sirven para poner las coordenadas para pulsar el botón.
float yMinima;
float xMaxima;
float yMaxima;
bool quit;
void update(int x, int y, bool click);
void setMouse(int x, int y, bool click);
bool sePulsaBoton(int x, int y, bool click);
bool mouseEncima(int x, int y, bool click);
void draw(int x, int y, bool click);
bool clicked(int M_x, int M_y, bool click);
virtual void funcionamiento()=0;
Button(int x_position, int y_position, Image* up, Image* down, RosalilaGraphics* painter);
Button();
virtual ~Button();
protected:
private:
};
#endif // BUTTON_H