aboutsummaryrefslogtreecommitdiff
path: root/example/rotation.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-20 17:54:33 -0400
committerGitHub <noreply@github.com>2017-06-20 17:54:33 -0400
commit33f2c66fca6e8a628fe3f36d1abacf87226042de (patch)
tree1381f243d1bb9df41691e2b92593a8495bb80f37 /example/rotation.c
parent2f03ea0a6bea6c099f148eb745a725ca77813885 (diff)
parentb9d36c8149536cff1aa229f59337dcfa2f70a37b (diff)
Merge pull request #17 from nyorain/wayland-backend
Basic Wayland backend
Diffstat (limited to 'example/rotation.c')
-rw-r--r--example/rotation.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/example/rotation.c b/example/rotation.c
index f4b7625e..d7b6b169 100644
--- a/example/rotation.c
+++ b/example/rotation.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <time.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include <wayland-server.h>
#include <wayland-server-protocol.h>
@@ -193,22 +194,22 @@ static void parse_args(int argc, char *argv[], struct wl_list *config) {
int main(int argc, char *argv[]) {
struct sample_state state = { 0 };
- struct compositor_state compositor;
wl_list_init(&state.config);
parse_args(argc, argv, &state.config);
- compositor_init(&compositor);
+ struct compositor_state compositor = { 0 };
+ compositor.data = &state;
compositor.output_add_cb = handle_output_add;
compositor.output_remove_cb = handle_output_remove;
compositor.output_frame_cb = handle_output_frame;
compositor.keyboard_key_cb = handle_keyboard_key;
+ compositor_init(&compositor);
state.renderer = wlr_gles3_renderer_init();
state.cat_texture = wlr_render_surface_init(state.renderer);
wlr_surface_attach_pixels(state.cat_texture, GL_RGBA,
cat_tex.width, cat_tex.height, cat_tex.pixel_data);
- compositor.data = &state;
compositor_run(&compositor);
wlr_surface_destroy(state.cat_texture);