Flesh out wayland backend somewhat, add example

This commit is contained in:
Drew DeVault 2017-04-25 15:06:58 -04:00
parent 52e6ed54cb
commit de01e654ce
17 changed files with 447 additions and 24 deletions

7
example/CMakeLists.txt Normal file
View file

@ -0,0 +1,7 @@
add_executable(example
main.c
)
target_link_libraries(example
wlr-backend
)

19
example/main.c Normal file
View file

@ -0,0 +1,19 @@
#define _POSIX_C_SOURCE 200112L
#include <stdlib.h>
#include <wlr/backend.h>
#include <wlr/backend/wayland.h>
#include <wayland-server.h>
int main(int argc, char **argv) {
// TODO: Move this stuff to a wlr backend selector function
char *_wl_display = getenv("WAYLAND_DISPLAY");
if (_wl_display) {
unsetenv("WAYLAND_DISPLAY");
setenv("_WAYLAND_DISPLAY", _wl_display, 1);
}
struct wl_display *wl_display = wl_display_create();
struct wlr_wl_backend *backend = wlr_wl_backend_init(wl_display, 1);
wlr_wl_backend_free(backend);
wl_display_destroy(wl_display);
return 0;
}