summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-06-03 10:49:49 +0100
committerCarl Hetherington <cth@carlh.net>2019-06-03 10:49:49 +0100
commit12096b85415ae72468f2f0591366b8cf3668a604 (patch)
tree80417681339bd78fc3a7b6666a017627a67014d1 /src
parent5495f1b4a9898526da6786b8161bb398d5cfe5bd (diff)
Fix some build failures due to GL stuff.
Diffstat (limited to 'src')
-rw-r--r--src/wx/gl_video_view.cc15
-rw-r--r--src/wx/gl_video_view.h1
-rw-r--r--src/wx/system_information_dialog.cc6
-rw-r--r--src/wx/wscript15
4 files changed, 36 insertions, 1 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index 90a4dfd5c..e1a8523cf 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -47,11 +47,26 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
_canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this));
_canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
+#ifdef DCPOMATIC_LINUX
if (_canvas->IsExtensionSupported("GLX_EXT_swap_control")) {
/* Enable vsync */
Display* dpy = wxGetX11Display();
glXSwapIntervalEXT (dpy, DefaultScreen(dpy), 1);
}
+#endif
+
+#ifdef DCPOMATIC_WINDOWS
+ if (_canvas->IsExtensionSupported("WGL_EXT_swap_control")) {
+ /* Enable vsync */
+ wglSwapIntervalEXT (1);
+ }
+
+#endif
+
+#ifdef DCPOMATIC_OSX
+ /* Enable vsync */
+ NSOpenGLCPSwapInterval = 1;
+#endif
glGenTextures (1, &_id);
glBindTexture (GL_TEXTURE_2D, _id);
diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h
index 42a3f89ba..c10f32335 100644
--- a/src/wx/gl_video_view.h
+++ b/src/wx/gl_video_view.h
@@ -23,7 +23,6 @@
#include <wx/glcanvas.h>
#include <dcp/util.h>
#include <boost/shared_ptr.hpp>
-
#undef None
#undef Success
diff --git a/src/wx/system_information_dialog.cc b/src/wx/system_information_dialog.cc
index 263083365..894239b65 100644
--- a/src/wx/system_information_dialog.cc
+++ b/src/wx/system_information_dialog.cc
@@ -42,5 +42,11 @@ SystemInformationDialog::SystemInformationDialog (wxWindow* parent)
add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false);
}
+ add (_("vsync"), true);
+#if !defined(DCPOMATIC_LINUX) || defined(DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT)
+ add (_("enabled"), false);
+#else
+ add (_("disabled"), false);
+#endif
layout ();
}
diff --git a/src/wx/wscript b/src/wx/wscript
index 89a02a3c6..f355189ef 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -257,6 +257,21 @@ def configure(conf):
conf.env.STLIB_GL = 'gl'
conf.env.STLIB_GLU = 'glu'
+ if conf.env.TARGET_LINUX:
+ conf.check_cxx(fragment="""
+ #include <wx/glcanvas.h>
+ #include <GL/glu.h>
+ #include <GL/glext.h>
+ #include <GL/glxext.h>
+ int main() {
+ glXSwapIntervalEXT (0, 0, 1);
+ return 0;
+ }
+ """,
+ msg='Checking for glXSwapIntervalEXT',
+ okmsg='yes',
+ uselib='GL WXWIDGETS',
+ define_name='DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT')
def build(bld):