summaryrefslogtreecommitdiff
path: root/examples/hello.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 13:44:13 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 13:44:13 +0300
commitc059e3aa7f93da470f052a5cd8ee0d8dc969e679 (patch)
tree63ffa378287ed2c606eda2e940501b9edc3d2b8b /examples/hello.c
parent87d0bc50d53dc216efb2b04495f090616318bc5c (diff)
rename and simplification
Diffstat (limited to 'examples/hello.c')
-rw-r--r--examples/hello.c12
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) {