-
Notifications
You must be signed in to change notification settings - Fork 2
/
mandelbrot.hpp
59 lines (40 loc) · 1.05 KB
/
mandelbrot.hpp
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
#ifndef gl_compute_mandelbrot_hpp_included__
#define gl_compute_mandelbrot_hpp_included__
#include <GL/gl.h>
#include <GL/glu.h>
#include <QtGui>
#include <QGLWidget>
#include <QSize>
#include "shader.hpp"
class RenderWidget : public QGLWidget
{
Q_OBJECT
public:
RenderWidget(const QGLFormat &format);
virtual ~RenderWidget() {}
protected:
Program progQuad, progCompute;
GLuint vao, tex;
void compileShaders();
void createTexture(QSize size);
virtual void initializeGL();
virtual void resizeGL(int width, int height);
virtual void paintGL();
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event);
virtual void keyPressEvent(QKeyEvent * event);
void zoom(double delta);
QSize curSize, texSize;
double aspect;
QPoint lastPos, centerPos;
double scale;
double panX, panY;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget* gl);
};
#endif // gl_compute_mandelbrot_hpp_included__