]> git.sesse.net Git - nageru/blob - glwidget.h
Hook up the preview window to a different chain.
[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
37 private:
38         Mixer::Output output;
39         movit::ResourcePool *resource_pool;
40         GLuint vao, program_num;
41         GLuint position_vbo, texcoord_vbo;
42 };
43
44 #endif