aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/CMakeLists.txt1
-rw-r--r--example/example-drm.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index dfb069b4..fb2f3823 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -12,4 +12,5 @@ add_executable(example-drm
target_link_libraries(example-drm
wlr-backend
+ wlr-session
)
diff --git a/example/example-drm.c b/example/example-drm.c
index 4c944226..a3a2a8fd 100644
--- a/example/example-drm.c
+++ b/example/example-drm.c
@@ -6,6 +6,7 @@
#include <GLES3/gl3.h>
#include <wlr/backend/drm.h>
+#include <wlr/session.h>
struct state {
float color[3];
@@ -92,7 +93,13 @@ int main()
wl_list_init(&state.render.link);
clock_gettime(CLOCK_MONOTONIC, &state.last_frame);
- struct wlr_drm_backend *wlr = wlr_drm_backend_init(&state.add, &state.rem, &state.render);
+ struct wlr_session *session = wlr_session_start();
+ if (!session) {
+ return 1;
+ }
+
+ struct wlr_drm_backend *wlr = wlr_drm_backend_init(session,
+ &state.add, &state.rem, &state.render);
bool done = false;
struct wl_event_loop *event_loop = wlr_drm_backend_get_event_loop(wlr);