-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathglmainwindow.h
82 lines (70 loc) · 2.08 KB
/
glmainwindow.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef GLMAINWINDOW_H
#define GLMAINWINDOW_H
#include <iostream>
#include "fmodcontroller.h"
#include <QGLWidget>
#include <QTimer>
#include <math.h>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QResizeEvent>
#include <SOIL/SOIL.h>
#define HOVER 0
#define NORMAL 1
#define CLICK 2
class GLMainWindow : public QGLWidget
{
Q_OBJECT
public:
explicit GLMainWindow(QWidget *parent = 0);
//Variables
QTimer *timer;
QPoint cursor1, cursor2;
//GL Variables
struct icon{
QString name;
GLuint logo[3];
QPoint centre;
float radius;
};
struct icon start;
struct icon stop;
struct icon increase;
struct icon decrease;
struct icon sound1;
struct icon sound2;
struct icon sound3;
struct icon sound4;
struct icon sound5;
struct icon sound6;
void paintGL();
//Initialisation Fucntions
void initializeGL();
void initialScene();
//Drawing Functions
void glowLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat thickness, QColor color);
void glowCircle(GLfloat x, GLfloat y, GLfloat radius, GLfloat thickness, QColor color, int startAngle, int endAngle);
void drawFillCircle(QPoint center, GLfloat radius);
void loadTextures();
void setupScene();
void drawTexture(GLuint texture, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
bool isInsideCircle(QPoint point, struct icon circle);
//Event Listeners
void mouseDoubleClickEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void resizeEvent(QResizeEvent *event);
signals:
void errorSignal(QString errorMessage);
void debugSignal(QString debugMessage);
void newControls(int controller1, int controller2);
public slots:
void debugSlot(QString message);
void errorSlot(QString message);
void repaint();
void updateControls(QPoint marker1, QPoint marker2);
};
#endif // GLMAINWINDOW_H