diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
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 <mgl/mgl.h> +#include <mgl/window/window.h> +#include <mgl/window/event.h> + +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; +} |