From ef9768858e5befde26db2cc4fec26a5e5bd0fe22 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 3 May 2017 22:40:19 +1200 Subject: Changed modesetting interface. --- example/CMakeLists.txt | 4 ++++ example/example-drm.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index fb2f3823..29a77675 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,3 +1,7 @@ +include_directories( + ${DRM_INCLUDE_DIRS} +) + add_executable(example main.c ) diff --git a/example/example-drm.c b/example/example-drm.c index 35a4f9a2..a2643949 100644 --- a/example/example-drm.c +++ b/example/example-drm.c @@ -23,8 +23,10 @@ void output_add(struct wl_listener *listener, void *data) { struct wlr_drm_output *out = data; - fprintf(stderr, "Output added\n"); - wlr_drm_output_modeset(out, "preferred"); + size_t num_modes; + struct wlr_drm_mode *modes = wlr_drm_output_get_modes(out, &num_modes); + + wlr_drm_output_modeset(out, &modes[0]); } void output_rem(struct wl_listener *listener, void *data) @@ -115,4 +117,5 @@ int main() wl_event_source_remove(timer); wlr_drm_backend_free(wlr); + wl_display_destroy(display); } -- cgit v1.2.3