From bf1deeb9f92535082c0f2bc2ca43ed1798f3fb89 Mon Sep 17 00:00:00 2001 From: rick Date: Mon, 1 May 2023 01:50:38 +0200 Subject: [PATCH] add exit button --- src/ui.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui.c b/src/ui.c index 996b77d..d38ff30 100644 --- a/src/ui.c +++ b/src/ui.c @@ -34,6 +34,8 @@ void free_ui(ui_infos *ptr) int draw_ui(ui_infos *ptr) { + int ret = 0; + /* en plein écran */ ImGuiViewport *vp = igGetMainViewport(); igSetNextWindowPos(vp->Pos, ImGuiCond_None, zero_vec2); @@ -100,9 +102,12 @@ int draw_ui(ui_infos *ptr) sleep(ptr->sleep_loop); } } + + if (igButton("Quit", zero_vec2)) + ret = 1; } igEnd(); - return 0; + return ret; }