From a48e1f65a93565564e34cb832eb778b6b5fc94f1 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 16 Dec 2018 02:48:02 +0000 Subject: [PATCH] Fix building with opengl, again Signed-off-by: Yuxuan Shui --- .editorconfig | 1 + src/common.h | 2 +- src/render.c | 14 ++++++++++++-- src/vsync.c | 3 +++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index 35278d4..a1aaac8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,3 +2,4 @@ root = true [*.{c,h}] indent_style = space indent_size = 2 +max_line_length = 90 diff --git a/src/common.h b/src/common.h index 60e7139..b9a8b2b 100644 --- a/src/common.h +++ b/src/common.h @@ -375,7 +375,7 @@ typedef struct glx_prog_main { #endif #else -typedef uint32_t glx_prog_main_t; +struct glx_prog_main { }; #endif #define PAINT_INIT { .pixmap = None, .pict = None } diff --git a/src/render.c b/src/render.c index 6703354..2f8f111 100644 --- a/src/render.c +++ b/src/render.c @@ -4,7 +4,11 @@ #include #include "common.h" + +#ifdef CONFIG_OPENGL #include "opengl.h" +#endif + #include "vsync.h" #include "win.h" @@ -76,7 +80,9 @@ void free_picture(xcb_connection_t *c, xcb_render_picture_t *p) { * Free paint_t. */ void free_paint(session_t *ps, paint_t *ppaint) { +#ifdef CONFIG_OPENGL free_paint_glx(ps, ppaint); +#endif free_picture(ps->c, &ppaint->pict); if (ppaint->pixmap) xcb_free_pixmap(ps->c, ppaint->pixmap); @@ -1214,9 +1220,13 @@ bool init_render(session_t *ps) { // Blur filter if (ps->o.blur_background || ps->o.blur_background_frame) { bool ret; - if (ps->o.backend == BKEND_GLX) + if (ps->o.backend == BKEND_GLX) { +#ifdef CONFIG_OPENGL ret = glx_init_blur(ps); - else +#else + assert(false); +#endif + } else ret = xr_init_blur(ps); if (!ret) return false; diff --git a/src/vsync.c b/src/vsync.c index a1ae076..17290eb 100644 --- a/src/vsync.c +++ b/src/vsync.c @@ -5,7 +5,10 @@ #include "common.h" #include "log.h" + +#ifdef CONFIG_OPENGL #include "opengl.h" +#endif #include "vsync.h"