modal
authorhgn <hgodden00@gmail.com>
Sat, 10 Jun 2023 10:46:37 +0000 (11:46 +0100)
committerhgn <hgodden00@gmail.com>
Sat, 10 Jun 2023 10:46:37 +0000 (11:46 +0100)
vg_imgui.h

index 1b5aceac38bfc931a723ac4bf24213ada60381c7..1d6cbb1139f1e76261f1de68e3a861bb25c6348c 100644 (file)
@@ -82,10 +82,18 @@ typedef u32 ui_scheme[8*4];
 #define UI_TEXTBOX_MULTILINE 0x1
 #define UI_TEXTBOX_WRAP      0x2
 #define UI_TEXTBOX_AUTOFOCUS 0x4
+
+#define UI_MODAL_OK  0x1
+#define UI_MODAL_YES 0x2
+#define UI_MODAL_NO  0x4
+#define UI_MODAL_CANCEL 0x8
+
 #define UI_MOUSE_LEFT   (SDL_BUTTON(SDL_BUTTON_LEFT))
 #define UI_MOUSE_RIGHT  (SDL_BUTTON(SDL_BUTTON_RIGHT))
 #define UI_MOUSE_MIDDLE (SDL_BUTTON(SDL_BUTTON_MIDDLE))
 
+
+
 struct{
    struct ui_vert *vertex_buffer;
    u16            *indice_buffer;
@@ -107,7 +115,8 @@ struct{
    enum ui_control_type{
       k_ui_control_none,
       k_ui_control_textbox,
-      k_ui_control_dropdown
+      k_ui_control_dropdown,
+               k_ui_control_modal
    }
    focused_control_type;
 
@@ -137,6 +146,16 @@ struct{
       ui_rect rect;
    }
    dropdown;
+
+       struct ui_modal{
+               const char *message;
+               u32 options;
+               
+               struct ui_modal_callbacks{
+                       void (*close)(u32);
+               }
+               callbacks;
+       };
    };
        
        GLuint tex_glyphs, vao, vbo, ebo;