Implement GLView::update.
authorCarl Hetherington <cth@carlh.net>
Wed, 20 Nov 2019 21:25:40 +0000 (22:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 8 Jan 2020 20:56:47 +0000 (21:56 +0100)
src/wx/gl_video_view.cc
src/wx/gl_video_view.h
src/wx/video_view.h

index 836b3eb351584b790e9c6f077c4e090b3d73277a..934a91ad5784d47f30ac8d615031fee5ac8edde2 100644 (file)
@@ -61,7 +61,7 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
        , _one_shot (false)
 {
        _canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
-       _canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this));
+       _canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::update, this));
        _canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
        _canvas->Bind (wxEVT_CREATE, boost::bind(&GLVideoView::create, this));
 
@@ -130,21 +130,13 @@ check_gl_error (char const * last)
        }
 }
 
-void
-GLVideoView::paint ()
-{
-       request_one_shot ();
-}
-
 void
 GLVideoView::update ()
 {
        if (!_canvas->IsShownOnScreen()) {
                return;
        }
-       /* XXX_b */
-//     wxClientDC dc (_canvas);
-//     draw ();
+       request_one_shot ();
 }
 
 void
index 614393024bfc825231990351d8d589be49ca2cfb..162438a5b49565af1391c462d0349ee53f409ab2 100644 (file)
@@ -50,7 +50,6 @@ public:
        }
 
 private:
-       void paint ();
        void draw ();
        void thread ();
        void request_one_shot ();
index 142cfd022d580135bdd530a938a905031add6a61..656d8621e779cdda57723918381656aa69231cd5 100644 (file)
@@ -46,6 +46,9 @@ public:
 
        virtual void set_image (boost::shared_ptr<const Image> image) = 0;
        virtual wxWindow* get () const = 0;
+       /** Redraw the view after something has changed like content outlining,
+        *  the film being removed, etc.
+        */
        virtual void update () = 0;
 
        /* XXX_b: make pure */