From 987f70c8e9b1bab87647d4ed20df79900d6c0c9e Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Sat, 14 Sep 2013 15:59:51 +0200 Subject: X11 clobberable window added --- samples/OpenGL/x11argb_opengl_glsl/x11argb_opengl_glsl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'samples/OpenGL/x11argb_opengl_glsl') diff --git a/samples/OpenGL/x11argb_opengl_glsl/x11argb_opengl_glsl.c b/samples/OpenGL/x11argb_opengl_glsl/x11argb_opengl_glsl.c index b658f5c..0852cbc 100644 --- a/samples/OpenGL/x11argb_opengl_glsl/x11argb_opengl_glsl.c +++ b/samples/OpenGL/x11argb_opengl_glsl/x11argb_opengl_glsl.c @@ -24,12 +24,17 @@ ------------------------------------------------------------------------*/ +#define _GNU_SOURCE + #include #include #include #include #include +#include +#include + #include #include #include @@ -571,7 +576,16 @@ static void redrawTheWindow(double T) draw_cube(); popModelview(); + struct timespec Ta, Tb; + + clock_gettime(CLOCK_MONOTONIC_RAW, &Ta); glXSwapBuffers(Xdisplay, glX_window_handle); + glXWaitGL(); + clock_gettime(CLOCK_MONOTONIC_RAW, &Tb); + + fprintf(stderr, "glXSwapBuffers + glXWaitGL returned after %f ms\n", + 1e3*( (double)Tb.tv_sec + 1e-9*(double)Tb.tv_nsec ) - + 1e3*( (double)Ta.tv_sec + 1e-9*(double)Ta.tv_nsec ) ); } static double getftime(void) { -- cgit v1.2.3