]> git.sesse.net Git - nageru/blob - glwidget.h
Run IWYU (plus lots of manual fiddling).
[nageru] / glwidget.h
1 #ifndef GLWIDGET_H
2 #define GLWIDGET_H
3
4 #include <epoxy/gl.h>
5 #include <QGLWidget>
6
7 class QWidget;
8
9 namespace movit {
10 class ResourcePool;
11 }
12
13 // Note: We use the older QGLWidget instead of QOpenGLWidget as it is
14 // much faster (does not go through a separate offscreen rendering step).
15 //
16 // TODO: Consider if QOpenGLWindow could do what we want.
17 class GLWidget : public QGLWidget
18 {
19         Q_OBJECT
20
21 public:
22         GLWidget(QWidget *parent = 0);
23         ~GLWidget();
24
25 protected:
26         void initializeGL() override;
27         void resizeGL(int width, int height) override;
28         void paintGL() override;
29
30 private:
31         movit::ResourcePool *resource_pool;
32         GLuint vao, program_num;
33         GLuint position_vbo, texcoord_vbo;
34 };
35
36 #endif