From: Carl Hetherington Date: Wed, 20 Nov 2019 21:25:40 +0000 (+0100) Subject: Implement GLView::update. X-Git-Tag: v2.15.40^2~22 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=89780827d5d6ec9127eae0108d10f71dc79d1a72;ds=sidebyside Implement GLView::update. --- diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index 836b3eb35..934a91ad5 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -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 diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h index 614393024..162438a5b 100644 --- a/src/wx/gl_video_view.h +++ b/src/wx/gl_video_view.h @@ -50,7 +50,6 @@ public: } private: - void paint (); void draw (); void thread (); void request_one_shot (); diff --git a/src/wx/video_view.h b/src/wx/video_view.h index 142cfd022..656d8621e 100644 --- a/src/wx/video_view.h +++ b/src/wx/video_view.h @@ -46,6 +46,9 @@ public: virtual void set_image (boost::shared_ptr 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 */