From c059e3aa7f93da470f052a5cd8ee0d8dc969e679 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 13:44:13 +0300 Subject: rename and simplification --- examples/hello.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'examples/hello.c') 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) { -- cgit v1.2.3