diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-20 17:54:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-20 17:54:33 -0400 |
commit | 33f2c66fca6e8a628fe3f36d1abacf87226042de (patch) | |
tree | 1381f243d1bb9df41691e2b92593a8495bb80f37 /example/touch.c | |
parent | 2f03ea0a6bea6c099f148eb745a725ca77813885 (diff) | |
parent | b9d36c8149536cff1aa229f59337dcfa2f70a37b (diff) |
Merge pull request #17 from nyorain/wayland-backend
Basic Wayland backend
Diffstat (limited to 'example/touch.c')
-rw-r--r-- | example/touch.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/example/touch.c b/example/touch.c index 46eddf62..1b4233bb 100644 --- a/example/touch.c +++ b/example/touch.c @@ -100,21 +100,21 @@ int main(int argc, char *argv[]) { struct sample_state state = { .touch_points = list_create() }; - struct compositor_state compositor; - + struct compositor_state compositor = { 0, + .data = &state, + .output_frame_cb = handle_output_frame, + .keyboard_key_cb = handle_keyboard_key, + .touch_down_cb = handle_touch_down, + .touch_up_cb = handle_touch_up, + .touch_motion_cb = handle_touch_motion, + }; compositor_init(&compositor); - compositor.output_frame_cb = handle_output_frame; - compositor.keyboard_key_cb = handle_keyboard_key; - compositor.touch_down_cb = handle_touch_down; - compositor.touch_up_cb = handle_touch_up; - compositor.touch_motion_cb = handle_touch_motion; 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); |