1
+ #pragma once
2
+
3
+ #include " stereokit.h"
4
+
5
+ #ifdef __cplusplus
6
+ namespace sk {
7
+ #endif
8
+
9
+ typedef enum ui_move_ {
10
+ ui_move_exact = 0 ,
11
+ ui_move_face_user,
12
+ ui_move_pos_only,
13
+ } ui_move_;
14
+
15
+ typedef enum ui_win_ {
16
+ ui_win_empty = 0 ,
17
+ ui_win_head = 1 << 0 ,
18
+ ui_win_body = 1 << 1 ,
19
+ ui_win_normal = ui_win_head | ui_win_body,
20
+ } ui_win_;
21
+
22
+ typedef enum ui_confirm_ {
23
+ ui_confirm_push,
24
+ ui_confirm_pinch,
25
+ ui_confirm_variable_pinch
26
+ } ui_confirm_;
27
+
28
+ typedef enum ui_vis_ {
29
+ ui_vis_none = 0 ,
30
+ ui_vis_default,
31
+ ui_vis_button,
32
+ ui_vis_toggle,
33
+ ui_vis_input,
34
+ ui_vis_handle,
35
+ ui_vis_window_body,
36
+ ui_vis_window_body_only,
37
+ ui_vis_window_head,
38
+ ui_vis_window_head_only,
39
+ ui_vis_max,
40
+ } ui_vis_;
41
+
42
+ typedef struct ui_settings_t {
43
+ float padding;
44
+ float gutter;
45
+ float depth;
46
+ float backplate_depth;
47
+ float backplate_border;
48
+ } ui_settings_t ;
49
+
50
+ SK_API void ui_quadrant_size_verts (vert_t *ref_vertices, int32_t vertex_count, float overflow_percent);
51
+ SK_API void ui_quadrant_size_mesh (mesh_t ref_mesh, float overflow_percent);
52
+ SK_API void ui_show_volumes (bool32_t show);
53
+ SK_API void ui_enable_far_interact (bool32_t enable);
54
+ SK_API bool32_t ui_far_interact_enabled ();
55
+ SK_API void ui_settings (ui_settings_t settings);
56
+ SK_API void ui_set_color (color128 color);
57
+ SK_API void ui_set_element_visual (ui_vis_ element_visual, mesh_t mesh, material_t material sk_default (nullptr ));
58
+ SK_API void ui_push_text_style (text_style_t style);
59
+ SK_API void ui_pop_text_style ();
60
+
61
+ SK_API void ui_layout_area (vec3 start, vec2 dimensions);
62
+ SK_API vec2 ui_layout_remaining ();
63
+ SK_API vec3 ui_layout_at ();
64
+ SK_API bounds_t ui_layout_last ();
65
+ SK_API bounds_t ui_layout_reserve (vec2 size, bool32_t add_padding sk_default (false ), float depth sk_default(0 ));
66
+
67
+ SK_API void ui_push_surface (pose_t surface_pose, vec3 layout_start sk_default (vec3_zero), vec2 layout_dimensions sk_default(vec2_zero));
68
+ SK_API void ui_pop_surface ();
69
+ SK_API vec2 ui_area_remaining (); // TODO: remove in v0.4, prefer ui_layout_remaining
70
+ SK_API void ui_nextline ();
71
+ SK_API void ui_sameline ();
72
+ SK_API float ui_line_height ();
73
+ SK_API void ui_space (float space);
74
+ SK_API uint64_t ui_push_id (const char *id);
75
+ SK_API uint64_t ui_push_id_16 (const char16_t *id);
76
+ SK_API uint64_t ui_push_idi (int32_t id);
77
+ SK_API void ui_pop_id ();
78
+ SK_API uint64_t ui_stack_hash (const char *string);
79
+ SK_API uint64_t ui_stack_hash_16 (const char16_t *string);
80
+
81
+ SK_API bool32_t ui_is_interacting (handed_ hand);
82
+ SK_API void ui_button_behavior (vec3 window_relative_pos, vec2 size, uint64_t id, sk_ref(float ) finger_offset, sk_ref(button_state_) button_state, sk_ref(button_state_) focus_state);
83
+
84
+ SK_API void ui_model_at (model_t model, vec3 start, vec3 size, color128 color);
85
+ SK_API button_state_ ui_volumei_at (const char *id, bounds_t bounds, ui_confirm_ interact_type, handed_ *out_opt_hand sk_default (nullptr ), button_state_ *out_opt_focus_state sk_default(nullptr ));
86
+ SK_API button_state_ ui_volumei_at_16 (const char16_t *id, bounds_t bounds, ui_confirm_ interact_type, handed_ *out_opt_hand sk_default (nullptr ), button_state_ *out_opt_focus_state sk_default(nullptr ));
87
+ SK_API bool32_t ui_volume_at (const char *id, bounds_t bounds); // TODO: remove in v0.4
88
+ SK_API bool32_t ui_volume_at_16 (const char16_t *id, bounds_t bounds); // TODO: remove in v0.4
89
+ SK_API button_state_ ui_interact_volume_at (bounds_t bounds, sk_ref(handed_) out_hand); // TODO: remove in v0.4
90
+ SK_API bool32_t ui_button_at (const char *text, vec3 window_relative_pos, vec2 size);
91
+ SK_API bool32_t ui_button_at_16 (const char16_t *text, vec3 window_relative_pos, vec2 size);
92
+ SK_API bool32_t ui_button_round_at (const char *text, sprite_t image, vec3 window_relative_pos, float diameter);
93
+ SK_API bool32_t ui_button_round_at_16 (const char16_t *text, sprite_t image, vec3 window_relative_pos, float diameter);
94
+ SK_API bool32_t ui_toggle_at (const char *text, sk_ref(bool32_t ) pressed, vec3 window_relative_pos, vec2 size);
95
+ SK_API bool32_t ui_toggle_at_16 (const char16_t *text, sk_ref(bool32_t ) pressed, vec3 window_relative_pos, vec2 size);
96
+ SK_API bool32_t ui_hslider_at (const char *id, sk_ref(float ) value, float min, float max, float step, vec3 window_relative_pos, vec2 size, ui_confirm_ confirm_method sk_default(ui_confirm_push));
97
+ SK_API bool32_t ui_hslider_at_16 (const char16_t *id, sk_ref(float ) value, float min, float max, float step, vec3 window_relative_pos, vec2 size, ui_confirm_ confirm_method sk_default(ui_confirm_push));
98
+ SK_API bool32_t ui_hslider_at_f64 (const char *id, sk_ref(double ) value, double min, double max, double step, vec3 window_relative_pos, vec2 size, ui_confirm_ confirm_method sk_default(ui_confirm_push));
99
+ SK_API bool32_t ui_hslider_at_f64_16 (const char16_t *id, sk_ref(double ) value, double min, double max, double step, vec3 window_relative_pos, vec2 size, ui_confirm_ confirm_method sk_default(ui_confirm_push));
100
+
101
+ SK_API void ui_hseparator ();
102
+ SK_API void ui_label (const char *text, bool32_t use_padding sk_default (true ));
103
+ SK_API void ui_label_16 (const char16_t *text, bool32_t use_padding sk_default (true ));
104
+ SK_API void ui_label_sz (const char *text, vec2 size);
105
+ SK_API void ui_label_sz_16 (const char16_t *text, vec2 size);
106
+ SK_API void ui_text (const char *text, text_align_ text_align sk_default (text_align_top_left));
107
+ SK_API void ui_text_16 (const char16_t *text, text_align_ text_align sk_default (text_align_top_left));
108
+ SK_API void ui_image (sprite_t image, vec2 size);
109
+ SK_API bool32_t ui_button (const char *text);
110
+ SK_API bool32_t ui_button_16 (const char16_t *text);
111
+ SK_API bool32_t ui_button_sz (const char *text, vec2 size);
112
+ SK_API bool32_t ui_button_sz_16 (const char16_t *text, vec2 size);
113
+ SK_API bool32_t ui_button_round (const char *id, sprite_t image, float diameter sk_default (0 ));
114
+ SK_API bool32_t ui_button_round_16 (const char16_t *id, sprite_t image, float diameter sk_default (0 ));
115
+ SK_API bool32_t ui_toggle (const char *text, sk_ref(bool32_t ) pressed);
116
+ SK_API bool32_t ui_toggle_16 (const char16_t *text, sk_ref(bool32_t ) pressed);
117
+ SK_API bool32_t ui_toggle_sz (const char *text, sk_ref(bool32_t ) pressed, vec2 size);
118
+ SK_API bool32_t ui_toggle_sz_16 (const char16_t *text, sk_ref(bool32_t ) pressed, vec2 size);
119
+ // SK_API bool32_t ui_toggle_round(const char *text, bool32_t &pressed);
120
+ SK_API void ui_model (model_t model, vec2 ui_size, float model_scale);
121
+ SK_API bool32_t ui_input (const char *id, char *buffer, int32_t buffer_size, vec2 size sk_default (vec2_zero));
122
+ SK_API bool32_t ui_input_16 (const char16_t *id, char16_t *buffer, int32_t buffer_size, vec2 size sk_default (vec2_zero));
123
+ SK_API bool32_t ui_hslider (const char *id, sk_ref(float ) value, float min, float max, float step sk_default(0 ), float width sk_default(0 ), ui_confirm_ confirm_method sk_default(ui_confirm_push));
124
+ SK_API bool32_t ui_hslider_16 (const char16_t *id, sk_ref(float ) value, float min, float max, float step sk_default(0 ), float width sk_default(0 ), ui_confirm_ confirm_method sk_default(ui_confirm_push));
125
+ SK_API bool32_t ui_hslider_f64 (const char *id, sk_ref(double ) value, double min, double max, double step sk_default(0 ), float width sk_default(0 ), ui_confirm_ confirm_method sk_default(ui_confirm_push));
126
+ SK_API bool32_t ui_hslider_f64_16 (const char16_t *id, sk_ref(double ) value, double min, double max, double step sk_default(0 ), float width sk_default(0 ), ui_confirm_ confirm_method sk_default(ui_confirm_push));
127
+ SK_API bool32_t ui_handle_begin (const char *text, sk_ref(pose_t ) movement, bounds_t handle, bool32_t draw, ui_move_ move_type sk_default(ui_move_exact));
128
+ SK_API bool32_t ui_handle_begin_16 (const char16_t *text, sk_ref(pose_t ) movement, bounds_t handle, bool32_t draw, ui_move_ move_type sk_default(ui_move_exact));
129
+ SK_API void ui_handle_end ();
130
+ SK_API void ui_window_begin (const char *text, sk_ref(pose_t ) pose, vec2 size sk_default({ 0 ,0 }), ui_win_ window_type sk_default(ui_win_normal), ui_move_ move_type sk_default(ui_move_face_user));
131
+ SK_API void ui_window_begin_16 (const char16_t *text, sk_ref(pose_t ) pose, vec2 size sk_default({ 0 ,0 }), ui_win_ window_type sk_default(ui_win_normal), ui_move_ move_type sk_default(ui_move_face_user));
132
+ SK_API void ui_window_end ();
133
+
134
+ #ifdef __cplusplus
135
+ } // namespace sk
136
+ #endif
0 commit comments