Skip to content

Commit

Permalink
De-macroify mu_begin_window
Browse files Browse the repository at this point in the history
  • Loading branch information
ashn-dot-dev committed Dec 27, 2023
1 parent 97e9db1 commit 01c39ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion microui.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ mu_slider_ex(mu_Context* ctx, mu_Real *value, mu_Real low, mu_Real high, mu_Real
int
mu_number(mu_Context* ctx, mu_Real *value, mu_Real step)
{
return mu_number_ex(ctx, value, step, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER)
return mu_number_ex(ctx, value, step, MU_SLIDER_FMT, MU_OPT_ALIGNCENTER);
}

int
Expand Down Expand Up @@ -1184,6 +1184,12 @@ end_root_container(mu_Context* ctx)
pop_container(ctx);
}

int
mu_begin_window(mu_Context* ctx, char const* title, mu_Rect rect)
{
return mu_begin_window_ex(ctx, title, rect, 0);
}

int
mu_begin_window_ex(mu_Context* ctx, char const* title, mu_Rect rect, int opt)
{
Expand Down
2 changes: 1 addition & 1 deletion microui.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ void mu_draw_control_text(mu_Context* ctx, char const* str, mu_Rect rect, int co
int mu_mouse_over(mu_Context* ctx, mu_Rect rect);
void mu_update_control(mu_Context* ctx, mu_Id id, mu_Rect rect, int opt);

#define mu_begin_window(ctx, title, rect) mu_begin_window_ex(ctx, title, rect, 0)
#define mu_begin_panel(ctx, name) mu_begin_panel_ex(ctx, name, 0)

void mu_text(mu_Context* ctx, char const* text);
Expand All @@ -287,6 +286,7 @@ int mu_header_ex(mu_Context* ctx, char const* label, int opt);
int mu_begin_treenode(mu_Context* ctx, char const* label);
int mu_begin_treenode_ex(mu_Context* ctx, char const* label, int opt);
void mu_end_treenode(mu_Context* ctx);
int mu_begin_window(mu_Context* ctx, char const* title, mu_Rect rect);
int mu_begin_window_ex(mu_Context* ctx, char const* title, mu_Rect rect, int opt);
void mu_end_window(mu_Context* ctx);
void mu_open_popup(mu_Context* ctx, char const* name);
Expand Down
2 changes: 1 addition & 1 deletion microui.sunder
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ extern func mu_draw_control_text(ctx: *mu_Context, str: *char, rect: mu_Rect, co
extern func mu_mouse_over(ctx: *mu_Context, rect: mu_Rect) sint;
extern func mu_update_control(ctx: *mu_Context, id: mu_Id, rect: mu_Rect, opt: sint) void;

func mu_begin_window(ctx: *mu_Context, title: *char, rect: mu_Rect) sint { return mu_begin_window_ex(ctx, title, rect, 0); }
func mu_begin_panel(ctx: *mu_Context, name: *char) void { mu_begin_panel_ex(ctx, name, 0); }

extern func mu_text(ctx: *mu_Context, text: *char) void;
Expand All @@ -252,6 +251,7 @@ extern func mu_begin_treenode_ex(ctx: *mu_Context, label: *char, opt: sint) sint
extern func mu_end_treenode(ctx: *mu_Context) void;
extern func mu_header(ctx: *mu_Context, label: *char) sint;
extern func mu_header_ex(ctx: *mu_Context, label: *char, opt: sint) sint;
extern func mu_begin_window(ctx: *mu_Context, title: *char, rect: mu_Rect) sint;
extern func mu_begin_window_ex(ctx: *mu_Context, title: *char, rect: mu_Rect, opt: sint) sint;
extern func mu_end_window(ctx: *mu_Context) void;
extern func mu_open_popup(ctx: *mu_Context, name: *char) void;
Expand Down

0 comments on commit 01c39ee

Please sign in to comment.