aboutsummaryrefslogtreecommitdiff
path: root/examples/toplevel-decoration.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-01-09 12:00:31 +0100
committerSimon Ser <contact@emersion.fr>2021-01-12 11:31:04 +0100
commit1d461687d24856a15fd8c37f744f40730888c9b0 (patch)
tree7d4a3856171310b71b0edb42e0b3b82204952f52 /examples/toplevel-decoration.c
parent50b120927ddcf26c83b219ebe9351b143efebfad (diff)
render/egl: replace init/finish with create/destroy
This ensures wlr_gles2_renderer can properly take ownership of the wlr_egl. Closes: https://github.com/swaywm/wlroots/issues/2612
Diffstat (limited to 'examples/toplevel-decoration.c')
-rw-r--r--examples/toplevel-decoration.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/toplevel-decoration.c b/examples/toplevel-decoration.c
index f10ac742..0369116a 100644
--- a/examples/toplevel-decoration.c
+++ b/examples/toplevel-decoration.c
@@ -20,7 +20,7 @@ static struct wl_compositor *compositor = NULL;
static struct xdg_wm_base *wm_base = NULL;
static struct zxdg_decoration_manager_v1 *decoration_manager = NULL;
-struct wlr_egl egl;
+struct wlr_egl *egl;
struct wl_egl_window *egl_window;
struct wlr_egl_surface *egl_surface;
@@ -53,7 +53,7 @@ static void request_preferred_mode(void) {
}
static void draw(void) {
- eglMakeCurrent(egl.display, egl_surface, egl_surface, egl.context);
+ eglMakeCurrent(egl->display, egl_surface, egl_surface, egl->context);
float color[] = {1.0, 1.0, 0.0, 1.0};
if (current_mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE) {
@@ -64,7 +64,7 @@ static void draw(void) {
glClearColor(color[0], color[1], color[2], 1.0);
glClear(GL_COLOR_BUFFER_BIT);
- eglSwapBuffers(egl.display, egl_surface);
+ eglSwapBuffers(egl->display, egl_surface);
}
static void xdg_surface_handle_configure(void *data,
@@ -219,7 +219,7 @@ int main(int argc, char **argv) {
}
EGLint attribs[] = { EGL_NONE };
- wlr_egl_init(&egl, EGL_PLATFORM_WAYLAND_EXT, display, attribs);
+ egl = wlr_egl_create(EGL_PLATFORM_WAYLAND_EXT, display, attribs);
struct wl_surface *surface = wl_compositor_create_surface(compositor);
struct xdg_surface *xdg_surface =
@@ -238,7 +238,7 @@ int main(int argc, char **argv) {
wl_surface_commit(surface);
egl_window = wl_egl_window_create(surface, width, height);
- egl_surface = wlr_egl_create_surface(&egl, egl_window);
+ egl_surface = wlr_egl_create_surface(egl, egl_window);
wl_display_roundtrip(display);