Merge pull request #555 from DMartinek/patch-1

CheckboxFlags: Added support for passing/testing multiple flags at the same time.
features/sdl_renderer3_multiviewports
omar ago%!(EXTRA string=9 years)
commit 8e8e59a942
  1. 6
      imgui.cpp

@ -6905,12 +6905,16 @@ bool ImGui::Checkbox(const char* label, bool* v)
bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value)
{
bool v = (*flags & flags_value) ? true : false;
bool v = ((*flags & flags_value) == flags_value);
bool pressed = ImGui::Checkbox(label, &v);
if (pressed)
{
if (v)
*flags |= flags_value;
else
*flags &= ~flags_value;
}
return pressed;
}

Loading…
Cancel
Save