Dominaezzz / kotlin-imgui

Kotlin bindings for Dear ImGui
MIT License
83 stars 4 forks source link

Make sure all Flag parameters are nullable #21

Open nlbuescher opened 3 years ago

nlbuescher commented 3 years ago

Ran into this problem just now: function like ImGui.treeNodeEx which optionally take a Flag<ImGuiTreeNodeFlags> don't currently support sending nullable flags:

val flags = (if (selected == current) ImGuiTreeNodeFlags.Selected else null) or ImGuiTreeNodeFlags.OpenOnArrow
ImGui.treeNodeEx(current.uuid(), flags, "Some node") // compile error: required Flag<ImGuiTreeNodeFlags>, found Flag<ImGuiTreeNodeFlags>?

there are a few workarounds, but since 0 is a valid Flag value, null should be accepted anywhere