]> git.sesse.net Git - nageru/blobdiff - glwidget.h
Clean up resources in the global ResourcePool on exit, in order to avoid some assert...
[nageru] / glwidget.h
index ae4902c12b1f51464981a6a2bd8c55fb78071e5d..857d733c42cf90e77ee51bf97aecdecea03d2231 100644 (file)
 class QMouseEvent;
 class QWidget;
 
+namespace movit {
+
+class ResourcePool;
+
+}  // namespace movit
+
 // Note: We use the older QGLWidget instead of QOpenGLWidget as it is
 // much faster (does not go through a separate offscreen rendering step).
 //
@@ -23,13 +29,14 @@ class GLWidget : public QGLWidget
 
 public:
        GLWidget(QWidget *parent = 0);
-       ~GLWidget();
 
        void set_output(Mixer::Output output)
        {
                this->output = output;
        }
 
+       void clean_context();
+
 protected:
        void initializeGL() override;
        void resizeGL(int width, int height) override;
@@ -45,6 +52,7 @@ private:
        Mixer::Output output;
        GLuint vao, program_num;
        GLuint position_vbo, texcoord_vbo;
+       movit::ResourcePool *resource_pool = nullptr;
 };
 
 #endif