Barely-functioning GL playback with new arrangement.
[dcpomatic.git] / src / wx / gl_video_view.h
index 54c64e4eae7c80c7ce31e441535a16a10ea0cca5..e32a1ede95eeea421b808733ea4b0a91058c5a6f 100644 (file)
 #include <wx/glcanvas.h>
 #include <dcp/util.h>
 #include <boost/shared_ptr.hpp>
-
+#include <boost/thread.hpp>
 #undef None
 #undef Success
 
 class GLVideoView : public VideoView
 {
 public:
-       GLVideoView (wxWindow* parent);
+       GLVideoView (FilmViewer* viewer, wxWindow* parent);
        ~GLVideoView ();
 
        void set_image (boost::shared_ptr<const Image> image);
@@ -38,13 +38,25 @@ public:
                return _canvas;
        }
        void update ();
+       void start ();
+
+       bool vsync_enabled () const {
+               return _vsync_enabled;
+       }
 
 private:
-        void paint ();
-        void draw ();
+       void paint ();
+       void draw ();
+       void thread ();
+       wxGLContext* context () const;
 
        wxGLCanvas* _canvas;
-        wxGLContext* _context;
-        GLuint _id;
-        boost::optional<dcp::Size> _size;
+
+       wxGLContext* _context;
+       mutable boost::mutex _context_mutex;
+
+       GLuint _id;
+       boost::optional<dcp::Size> _size;
+       bool _vsync_enabled;
+       boost::thread* _thread;
 };