Fixes for building with newer wxWidgets.
[dcpomatic.git] / src / wx / gl_video_view.cc
index b22f0fb62b6815b7d0988c6dfa5c72aa3b922cc1..a82d5a27688e156f0c5eab8f8b7aa82fdc6de02d 100644 (file)
@@ -40,7 +40,6 @@
 #ifdef DCPOMATIC_LINUX
 #include <GL/glu.h>
 #include <GL/glext.h>
-#include <GL/glxext.h>
 #endif
 
 #ifdef DCPOMATIC_WINDOWS
@@ -74,7 +73,6 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
        _canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
        _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));
 
        _canvas->Bind (wxEVT_TIMER, boost::bind(&GLVideoView::check_for_butler_errors, this));
        _timer.reset (new wxTimer(_canvas));
@@ -111,6 +109,10 @@ GLVideoView::check_for_butler_errors ()
 void
 GLVideoView::update ()
 {
+       if (!_thread.joinable()) {
+               _thread = boost::thread (boost::bind(&GLVideoView::thread, this));
+       }
+
        {
                boost::mutex::scoped_lock lm (_canvas_mutex);
                if (!_canvas->IsShownOnScreen()) {
@@ -331,7 +333,7 @@ try
 {
        {
                boost::mutex::scoped_lock lm (_canvas_mutex);
-               _context = new wxGLContext (_canvas); //local
+               _context = new wxGLContext (_canvas);
                _canvas->SetCurrent (*_context);
        }
 
@@ -414,10 +416,3 @@ GLVideoView::request_one_shot ()
        _thread_work_condition.notify_all ();
 }
 
-void
-GLVideoView::create ()
-{
-       if (!_thread.joinable()) {
-               _thread = boost::thread (boost::bind(&GLVideoView::thread, this));
-       }
-}