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