diff options
Diffstat (limited to 'examples/hello.c')
| -rw-r--r-- | examples/hello.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/examples/hello.c b/examples/hello.c index 1761e04..d3d74cf 100644 --- a/examples/hello.c +++ b/examples/hello.c @@ -5,20 +5,6 @@ static bool failed; -static enum yasl_app_result init(void *ud, struct yasl_display *display) -{ - (void)ud; - struct yasl_window_spec spec = {.title = "Hello YASL", .size = {640, 480}}; - struct yasl_surface *surface = yasl_surface_create_toplevel(display, &spec); - if (!surface) { - perror("yasl_surface_create_toplevel"); - failed = true; - return YASL_APP_QUIT; - } - yasl_surface_request_frame(surface); - return YASL_APP_CONTINUE; -} - static enum yasl_app_result event(void *ud, const struct yasl_event *event) { (void)ud; @@ -41,9 +27,10 @@ static void draw(void *ud, struct yasl_surface *surface, struct yasl_frame_conte int main(void) { + struct yasl_window_spec window = {.title = "Hello YASL", .size = {640, 480}}; struct yasl_app_desc desc = { .app_id = "org.example.hello", - .init = init, + .window = &window, .event = event, .frame = draw, }; |
