-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachinewindow.h
68 lines (49 loc) · 1.34 KB
/
machinewindow.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
#ifndef MACHINEWINDOW_H
#define MACHINEWINDOW_H
#include <QWindow>
#include <QOpenGLContext>
#include <QOpenGLFunctions_3_2_Core>
#include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLDebugLogger>
#include <QOpenGLDebugMessage>
#include <QMatrix4x4>
#include <QPoint>
#include <QList>
#include "word.h"
class MachineWindow : public QWindow
{
Q_OBJECT
public:
explicit MachineWindow(QWindow *parent = 0);
~MachineWindow();
virtual void initialize();
virtual void render();
virtual void render(QPainter *painter);
void setProgram(QList<Word*>& prog);
signals:
void readyForData();
public slots:
protected:
virtual void exposeEvent(QExposeEvent* evt);
virtual void resizeEvent(QResizeEvent* evt);
virtual void mousePressEvent(QMouseEvent *evt);
virtual void mouseMoveEvent(QMouseEvent *evt);
private:
QOpenGLDebugLogger* _logger;
QOpenGLShaderProgram _shaderProg;
bool _hasInitialized;
QOpenGLContext* _context;
QOpenGLFunctions_3_2_Core* _gl;
QOpenGLVertexArrayObject* _vao;
QList<Word*> _program;
QOpenGLBuffer _positions;
QMatrix4x4 _matModel;
QMatrix4x4 _matView;
QMatrix4x4 _matProject;
QPoint _dragStart;
private slots:
void onDebugMsg(QOpenGLDebugMessage msg);
};
#endif // MACHINEWINDOW_H