MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / GetVoidPtrRef

Method GetVoidPtrRef

imgui_tiny_app/imgui/imgui.cpp:3034–3040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3032}
3033
3034void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val)
3035{
3036 ImGuiStoragePair* it = ImLowerBound(Data.Data, Data.Data + Data.Size, key);
3037 if (it == Data.Data + Data.Size || it->key != key)
3038 it = Data.insert(it, ImGuiStoragePair(key, default_val));
3039 return &it->val_p;
3040}
3041
3042// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
3043void ImGuiStorage::SetInt(ImGuiID key, int val)

Callers 1

ImFontAtlasBakedGetOrAddFunction · 0.80

Calls 2

ImGuiStoragePairClass · 0.85
ImLowerBoundFunction · 0.70

Tested by

no test coverage detected