summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-06-03 01:28:57 +0100
committerCarl Hetherington <cth@carlh.net>2019-06-03 01:28:57 +0100
commit5495f1b4a9898526da6786b8161bb398d5cfe5bd (patch)
treec3dd3ddb4419b137c5852e6181fbca3352840f1b /src
parentb0bec103eaaebfbc0b6f90f9b3e7ac8c32f2707e (diff)
Try to enable vsync with GL on Linux.
Diffstat (limited to 'src')
-rw-r--r--src/wx/gl_video_view.cc7
-rw-r--r--src/wx/wscript3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index 39532ab79..90a4dfd5c 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -32,6 +32,7 @@
#else
#include <GL/glu.h>
#include <GL/glext.h>
+#include <GL/glxext.h>
#endif
using std::cout;
@@ -46,6 +47,12 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
_canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this));
_canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
+ if (_canvas->IsExtensionSupported("GLX_EXT_swap_control")) {
+ /* Enable vsync */
+ Display* dpy = wxGetX11Display();
+ glXSwapIntervalEXT (dpy, DefaultScreen(dpy), 1);
+ }
+
glGenTextures (1, &_id);
glBindTexture (GL_TEXTURE_2D, _id);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
diff --git a/src/wx/wscript b/src/wx/wscript
index 8430b5844..89a02a3c6 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -180,6 +180,9 @@ def configure(conf):
uselib_store='WXWIDGETS',
mandatory=True)
+ if conf.env.TARGET_LINUX:
+ conf.env.append_value('CXXFLAGS', ['-DGLX_GLXEXT_PROTOTYPES'])
+
if conf.options.static_wxwidgets:
# wx-config returns its static libraries as full paths, without -l prefixes, which confuses
# check_cfg(). It puts the static libraries into LINKFLAGS_WXWIDGETS, so fish them out.