Skip to content

Switch nk_bool flags to nk_uint with NK_FLAG enums#233

Open
RobLoach wants to merge 5 commits into
masterfrom
fix/nk-bool-to-nk-flag
Open

Switch nk_bool flags to nk_uint with NK_FLAG enums#233
RobLoach wants to merge 5 commits into
masterfrom
fix/nk-bool-to-nk-flag

Conversation

@RobLoach
Copy link
Copy Markdown
Owner

@RobLoach RobLoach commented Jun 1, 2026

Replace individual nk_bool selectable/disabled/visible fields in nk_console and the per-frame booleans in nk_console_top_data with single nk_uint flags/state fields backed by nk_console_flag and nk_console_top_flag enums, reducing memory use per widget instance.

Fixes #97

@RobLoach RobLoach self-assigned this Jun 1, 2026
@RobLoach
Copy link
Copy Markdown
Owner Author

RobLoach commented Jun 1, 2026

error: ‘nk_console’ has no member named disabled_SET_

nuklear_console_demo.c:136:147: error: expected ‘;’ before ‘}’ token
136 | if (!(other->flags & NK_CONSOLE_FLAG_VISIBLE)) other->flags |= NK_CONSOLE_FLAG_VISIBLE; else other->flags &= ~(nk_uint)NK_CONSOLE_FLAG_VISIBLE
|

Comment thread demo/common/nuklear_console_demo.c Outdated
@RobLoach RobLoach marked this pull request as draft June 1, 2026 04:01
@RobLoach RobLoach marked this pull request as ready for review June 1, 2026 19:45
Comment thread demo/common/nuklear_console_demo.c Outdated
Comment on lines +296 to +297
nk_console_radio(radios, "Disabled", &radio_option2)->disabled_SET_;
nk_console_radio(radios, "Invisible", &radio_option2)->visible_CLEAR_;
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled_SET_ is not a thing. Neither is visible_CLEAR_.

@RobLoach RobLoach marked this pull request as draft June 1, 2026 20:56
@RobLoach RobLoach marked this pull request as ready for review June 1, 2026 21:49
@RobLoach RobLoach removed their assignment Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch nk_bool flags to a single nk_uint using NK_FLAG with enums

1 participant