]> git.sesse.net Git - nageru/blob - glwidget.h
Wire the transition names through to the UI.
[nageru] / glwidget.h
1 #ifndef GLWIDGET_H
2 #define GLWIDGET_H
3
4 #include <epoxy/gl.h>
5 #include <QGLWidget>
6
7 #include "mixer.h"
8
9 class QWidget;
10
11 namespace movit {
12 class ResourcePool;
13 }
14
15 // Note: We use the older QGLWidget instead of QOpenGLWidget as it is
16 // much faster (does not go through a separate offscreen rendering step).
17 //
18 // TODO: Consider if QOpenGLWindow could do what we want.
19 class GLWidget : public QGLWidget
20 {
21         Q_OBJECT
22
23 public:
24         GLWidget(QWidget *parent = 0);
25         ~GLWidget();
26
27         void set_output(Mixer::Output output)
28         {
29                 this->output = output;
30         }
31
32 protected:
33         void initializeGL() override;
34         void resizeGL(int width, int height) override;
35         void paintGL() override;
36         void mousePressEvent(QMouseEvent *event) override;
37
38 signals:
39         void clicked();
40         void transition_names_updated(std::vector<std::string> transition_names);
41
42 private:
43         Mixer::Output output;
44         movit::ResourcePool *resource_pool;
45         GLuint vao, program_num;
46         GLuint position_vbo, texcoord_vbo;
47 };
48
49 #endif