summaryrefslogtreecommitdiff
path: root/src/wx/gl_video_view.cc
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/wx/gl_video_view.cc
parent5495f1b4a9898526da6786b8161bb398d5cfe5bd (diff)
Fix some build failures due to GL stuff.
Diffstat (limited to 'src/wx/gl_video_view.cc')
-rw-r--r--src/wx/gl_video_view.cc15
1 files changed, 15 insertions, 0 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);