diff options
Diffstat (limited to 'examples/hello.c')
| -rw-r--r-- | examples/hello.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/hello.c b/examples/hello.c index 67ac88b..0c474c2 100644 --- a/examples/hello.c +++ b/examples/hello.c @@ -72,17 +72,19 @@ int main(int argc, char **argv) perror("yasl_display_open"); return 1; } - struct yasl_surface_spec spec = {.title = "Hello YASL", .size = {640, 480}}; + struct yasl_window_cbs callbacks = { + .draw = draw, .configure = configure, .close = close_window, + }; + struct yasl_window_spec spec = { + .title = "Hello YASL", .size = {640, 480}, + .cbs = &callbacks, .ud = &app, + }; struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); if (!surface) { perror("yasl_surface_create_toplevel"); yasl_display_close(display); return 1; } - struct yasl_surface_cbs callbacks = { - .draw = draw, .configure = configure, .close = close_window, - }; - yasl_surface_set_callbacks(surface, &callbacks, &app); yasl_surface_schedule_redraw(surface); while (app.running) { |
