Fix building with opengl, again

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-16 02:48:02 +00:00
parent 9ce1387f52
commit a48e1f65a9
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
4 changed files with 17 additions and 3 deletions

View File

@ -2,3 +2,4 @@ root = true
[*.{c,h}] [*.{c,h}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
max_line_length = 90

View File

@ -375,7 +375,7 @@ typedef struct glx_prog_main {
#endif #endif
#else #else
typedef uint32_t glx_prog_main_t; struct glx_prog_main { };
#endif #endif
#define PAINT_INIT { .pixmap = None, .pict = None } #define PAINT_INIT { .pixmap = None, .pict = None }

View File

@ -4,7 +4,11 @@
#include <xcb/xcb_image.h> #include <xcb/xcb_image.h>
#include "common.h" #include "common.h"
#ifdef CONFIG_OPENGL
#include "opengl.h" #include "opengl.h"
#endif
#include "vsync.h" #include "vsync.h"
#include "win.h" #include "win.h"
@ -76,7 +80,9 @@ void free_picture(xcb_connection_t *c, xcb_render_picture_t *p) {
* Free paint_t. * Free paint_t.
*/ */
void free_paint(session_t *ps, paint_t *ppaint) { void free_paint(session_t *ps, paint_t *ppaint) {
#ifdef CONFIG_OPENGL
free_paint_glx(ps, ppaint); free_paint_glx(ps, ppaint);
#endif
free_picture(ps->c, &ppaint->pict); free_picture(ps->c, &ppaint->pict);
if (ppaint->pixmap) if (ppaint->pixmap)
xcb_free_pixmap(ps->c, ppaint->pixmap); xcb_free_pixmap(ps->c, ppaint->pixmap);
@ -1214,9 +1220,13 @@ bool init_render(session_t *ps) {
// Blur filter // Blur filter
if (ps->o.blur_background || ps->o.blur_background_frame) { if (ps->o.blur_background || ps->o.blur_background_frame) {
bool ret; bool ret;
if (ps->o.backend == BKEND_GLX) if (ps->o.backend == BKEND_GLX) {
#ifdef CONFIG_OPENGL
ret = glx_init_blur(ps); ret = glx_init_blur(ps);
else #else
assert(false);
#endif
} else
ret = xr_init_blur(ps); ret = xr_init_blur(ps);
if (!ret) if (!ret)
return false; return false;

View File

@ -5,7 +5,10 @@
#include "common.h" #include "common.h"
#include "log.h" #include "log.h"
#ifdef CONFIG_OPENGL
#include "opengl.h" #include "opengl.h"
#endif
#include "vsync.h" #include "vsync.h"