aboutsummaryrefslogtreecommitdiff
path: root/examples/toplevel-decoration.c
diff options
context:
space:
mode:
authorBrandon Dowdy <berylline@users.noreply.github.com>2021-01-28 23:13:53 +0000
committerSimon Ser <contact@emersion.fr>2021-01-29 10:03:24 +0100
commit34e7f69d6942bd37361f27c5894edc9f522d49e1 (patch)
treee1f722c0114453371711acf471afc2c38e1d2d88 /examples/toplevel-decoration.c
parent50b9921642af61487e2d0f425695342bf7c4ad78 (diff)
examples: remove dependency on wlr_egl from clients
The specified clients in this commit used to rely on wlr_egl and some of its related functions in order to render surfaces. This is no longer the case as of this commit.
Diffstat (limited to 'examples/toplevel-decoration.c')
-rw-r--r--examples/toplevel-decoration.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/toplevel-decoration.c b/examples/toplevel-decoration.c
index 0369116a..bdcdf845 100644
--- a/examples/toplevel-decoration.c
+++ b/examples/toplevel-decoration.c
@@ -5,6 +5,7 @@
#include <wayland-client.h>
#include <wayland-egl.h>
#include <wlr/render/egl.h>
+#include "egl_common.h"
#include "xdg-shell-client-protocol.h"
#include "xdg-decoration-unstable-v1-client-protocol.h"
@@ -20,7 +21,6 @@ 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 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,
@@ -218,8 +218,7 @@ int main(int argc, char **argv) {
return EXIT_FAILURE;
}
- EGLint attribs[] = { EGL_NONE };
- egl = wlr_egl_create(EGL_PLATFORM_WAYLAND_EXT, display, attribs);
+ egl_init(display);
struct wl_surface *surface = wl_compositor_create_surface(compositor);
struct xdg_surface *xdg_surface =
@@ -238,7 +237,8 @@ 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 = eglCreatePlatformWindowSurfaceEXT(
+ egl_display, egl_config, egl_window, NULL);
wl_display_roundtrip(display);