diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2021-12-16 11:50:11 -0600 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2021-12-16 11:50:11 -0600 |
commit | 27f66c87152765942324f85be6b83d0028de295e (patch) | |
tree | b58049fe9620a6ef93ad84498e77c4e4814c5869 | |
parent | 52dbc97ed69f368e63fae57b028072f01d07ee7d (diff) |
explicitly create renderer and allocator
autocreate was removed
-rw-r--r-- | dwl.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -13,6 +13,7 @@ #include <libinput.h> #include <wayland-server-core.h> #include <wlr/backend.h> +#include <wlr/render/allocator.h> #include <wlr/render/wlr_renderer.h> #include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_cursor.h> @@ -307,6 +308,7 @@ static const char broken[] = "broken"; static struct wl_display *dpy; static struct wlr_backend *backend; static struct wlr_renderer *drw; +static struct wlr_allocator *alloc; static struct wlr_compositor *compositor; static struct wlr_xdg_shell *xdg_shell; @@ -822,6 +824,8 @@ createmon(struct wl_listener *listener, void *data) Monitor *m = wlr_output->data = calloc(1, sizeof(*m)); m->wlr_output = wlr_output; + wlr_output_init_render(wlr_output, alloc, drw); + /* Initialize monitor state using configured rules */ for (size_t i = 0; i < LENGTH(m->layers); i++) wl_list_init(&m->layers[i]); @@ -2006,12 +2010,15 @@ setup(void) if (!(backend = wlr_backend_autocreate(dpy))) BARF("couldn't create backend"); - /* If we don't provide a renderer, autocreate makes a GLES2 renderer for us. - * The renderer is responsible for defining the various pixel formats it - * supports for shared memory, this configures that for clients. */ - drw = wlr_backend_get_renderer(backend); + /* Create a renderer with the default implementation */ + if (!(drw = wlr_renderer_autocreate(backend))) + BARF("couldn't create renderer"); wlr_renderer_init_wl_display(drw, dpy); + /* Create a default allocator */ + if (!(alloc = wlr_allocator_autocreate(backend, drw))) + BARF("couldn't create allocator"); + /* This creates some hands-off wlroots interfaces. The compositor is * necessary for clients to allocate surfaces and the data device manager * handles the clipboard. Each of these wlroots interfaces has room for you |