diff options
Diffstat (limited to 'backend/headless')
-rw-r--r-- | backend/headless/backend.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c index cef8eec4..61409d41 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -1,6 +1,6 @@ #include <stdlib.h> -#include <EGL/egl.h> -#include <EGL/eglext.h> +#include <wlr/render/egl.h> +#include <wlr/render/gles2.h> #include <wlr/util/log.h> #include <wlr/interfaces/wlr_output.h> #include <wlr/interfaces/wlr_input_device.h> @@ -61,10 +61,18 @@ static struct wlr_egl *backend_get_egl(struct wlr_backend *wlr_backend) { return &backend->egl; } +static struct wlr_renderer *backend_get_renderer( + struct wlr_backend *wlr_backend) { + struct wlr_headless_backend *backend = + (struct wlr_headless_backend *)wlr_backend; + return backend->renderer; +} + static const struct wlr_backend_impl backend_impl = { .start = backend_start, .destroy = backend_destroy, .get_egl = backend_get_egl, + .get_renderer = backend_get_renderer, }; static void handle_display_destroy(struct wl_listener *listener, void *data) { @@ -103,6 +111,11 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) { return NULL; } + backend->renderer = wlr_gles2_renderer_create(&backend->backend); + if (backend->renderer == NULL) { + wlr_log(L_ERROR, "Failed to create renderer"); + } + backend->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &backend->display_destroy); |