aboutsummaryrefslogtreecommitdiff
path: root/examples/keyboard-shortcuts-inhibit.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/keyboard-shortcuts-inhibit.c')
-rw-r--r--examples/keyboard-shortcuts-inhibit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/keyboard-shortcuts-inhibit.c b/examples/keyboard-shortcuts-inhibit.c
index 58684683..da40838d 100644
--- a/examples/keyboard-shortcuts-inhibit.c
+++ b/examples/keyboard-shortcuts-inhibit.c
@@ -5,6 +5,7 @@
#include <wayland-client.h>
#include <wayland-egl.h>
#include <wlr/render/egl.h>
+#include "egl_common.h"
#include "keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h"
#include "xdg-shell-client-protocol.h"
@@ -33,12 +34,11 @@ static struct zwp_keyboard_shortcuts_inhibitor_v1 *
keyboard_shortcuts_inhibitor = NULL;
static bool active = false;
-struct wlr_egl *egl;
struct wl_egl_window *egl_window;
struct wlr_egl_surface *egl_surface;
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 (keyboard_shortcuts_inhibitor) {
@@ -49,7 +49,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 keyboard_shortcuts_inhibit_handle_active(void *data,
@@ -224,8 +224,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 =
@@ -241,7 +240,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);