aboutsummaryrefslogtreecommitdiff
path: root/include/mgui
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-09-28 20:10:07 +0200
committerdec05eba <dec05eba@protonmail.com>2023-01-11 15:23:39 +0100
commita338adecd93b328816b4a3ff51bfb278377c7cf9 (patch)
tree6abd7791bae10213d34b7a2928f08f4f77190fc0 /include/mgui
parent44e987c8521a99519350a42292bcfcd28451dcbd (diff)
margin, scroll, richtextHEADmaster
Diffstat (limited to 'include/mgui')
-rw-r--r--include/mgui/mgui.h8
-rw-r--r--include/mgui/richtext.h3
-rw-r--r--include/mgui/scrollview.h6
3 files changed, 11 insertions, 6 deletions
diff --git a/include/mgui/mgui.h b/include/mgui/mgui.h
index cb018d5..024a062 100644
--- a/include/mgui/mgui.h
+++ b/include/mgui/mgui.h
@@ -5,14 +5,14 @@ typedef struct mgui_widget mgui_widget;
typedef struct mgl_event mgl_event;
typedef struct mgl_window mgl_window;
-void mgui_init();
-void mgui_deinit();
+void mgui_init(void);
+void mgui_deinit(void);
void mgui_on_event(mgui_widget *root_widget, mgl_window *window, mgl_event *event);
/* This should only be called once every frame */
void mgui_draw(mgui_widget *root_widget, mgl_window *window);
/* Clamped to 1.0 second */
-double mgui_get_seconds_since_last_update();
+double mgui_get_seconds_since_last_update(void);
/* Clamped to 1.0 second */
-double mgui_get_frame_time_seconds();
+double mgui_get_frame_time_seconds(void);
#endif /* MGUI_H */
diff --git a/include/mgui/richtext.h b/include/mgui/richtext.h
index f3b07a5..98b46c6 100644
--- a/include/mgui/richtext.h
+++ b/include/mgui/richtext.h
@@ -21,7 +21,8 @@ typedef struct {
mgl_vec2i position;
mgl_vec2i render_size;
int width;
- mgui_richtext_vertex_data vertex_data[2];
+ mgui_richtext_vertex_data vertex_data[2]; /* size should match NUM_VERTEX_DATA */
+ /* TODO: Turn bools into flags */
bool dirty;
bool vertices_dirty;
} mgui_richtext;
diff --git a/include/mgui/scrollview.h b/include/mgui/scrollview.h
index dded990..76ae6d5 100644
--- a/include/mgui/scrollview.h
+++ b/include/mgui/scrollview.h
@@ -9,9 +9,13 @@ typedef struct {
mgl_vec2i position;
mgl_vec2i scroll;
mgl_vec2f mouse_scroll;
+ mgl_vec2f scrollbar_pos;
+ mgl_vec2f scrollbar_size;
+ mgl_vec2f scrollbar_move_prev_pos;
+ bool moving_scrollbar;
} mgui_scrollview;
-mgui_scrollview* mgui_scrollview_create();
+mgui_scrollview* mgui_scrollview_create(void);
void mgui_scrollview_destroy(mgui_scrollview *scrollview);
mgui_widget* mgui_scrollview_to_widget(mgui_scrollview *list);
mgui_scrollview* mgui_widget_to_scrollview(mgui_widget *widget);