_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);
#include <wx/glcanvas.h>
#include <dcp/util.h>
#include <boost/shared_ptr.hpp>
-
#undef None
#undef Success
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 ();
}
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):