diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
| commit | c059e3aa7f93da470f052a5cd8ee0d8dc969e679 (patch) | |
| tree | 63ffa378287ed2c606eda2e940501b9edc3d2b8b /tests/cocoa/test_native.c | |
| parent | 87d0bc50d53dc216efb2b04495f090616318bc5c (diff) | |
rename and simplification
Diffstat (limited to 'tests/cocoa/test_native.c')
| -rw-r--r-- | tests/cocoa/test_native.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/cocoa/test_native.c b/tests/cocoa/test_native.c index 0c101dd..674513d 100644 --- a/tests/cocoa/test_native.c +++ b/tests/cocoa/test_native.c @@ -48,11 +48,14 @@ static void test_window(enum yasl_backend request, bool null_spec) struct state state = {.display = yasl_display_open(NULL, null_spec ? NULL : &spec)}; assert(state.display); assert(yasl_display_backend(state.display) == YASL_BACKEND_COCOA); - struct yasl_surface_spec surface = {.title = "Native backend test", .size = {160, 100}}; + struct yasl_window_cbs callbacks = {.draw = draw}; + struct yasl_window_spec surface = { + .title = "Native backend test", .size = {160, 100}, + .cbs = &callbacks, .ud = &state, + }; state.surface = yasl_surface_create_toplevel(state.display, &surface); assert(state.surface); - struct yasl_surface_cbs callbacks = {.draw = draw}; - yasl_surface_set_callbacks(state.surface, &callbacks, &state); + assert(!state.draws); callbacks.draw = NULL; yasl_surface_schedule_redraw(state.surface); uint64_t deadline = yasl_loop_now_ns() + 3000000000ull; |
