From 14770f42df291753a240def91fb488a904a909c1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 2 Dec 2021 14:20:48 +0100 Subject: Initial commit, set up skeleton with list and button --- tests/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/main.c (limited to 'tests') diff --git a/tests/main.c b/tests/main.c new file mode 100644 index 0000000..6a94414 --- /dev/null +++ b/tests/main.c @@ -0,0 +1,32 @@ +#include "../include/mgui/list.h" +#include "../include/mgui/button.h" +#include +#include +#include + +int main() { + if(mgl_init() != 0) + return 1; + + mgl_window window; + if(mgl_window_create(&window, "mgl", &(mgl_window_create_params){ .size = {1280, 720} }) != 0) + return 1; + + mgui_list *list = mgui_list_create(MGUI_LIST_VERTICAL); + mgui_button *button = mgui_button_create(); + mgui_list_append(list, mgui_button_to_widget(button)); + + mgl_event event; + while(mgl_window_is_open(&window)) { + while(mgl_window_poll_event(&window, &event)) { + mgui_list_on_event(list, &window, &event); + } + + mgl_window_clear(&window, (mgl_color){0, 0, 0, 0}); + mgui_list_draw(list, &window); + mgl_window_display(&window); + } + + mgl_deinit(); + return 0; +} -- cgit v1.2.3