MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / CreateNewWindowSettings

Method CreateNewWindowSettings

3rdparty/imgui/src/imgui.cpp:15685–15702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15683}
15684
15685ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
15686{
15687 ImGuiContext& g = *GImGui;
15688
15689 // Preserve the full string when ConfigDebugVerboseIniSettings is set to make .ini inspection easier.
15690 if (g.IO.ConfigDebugIniSettings == false)
15691 name = ImHashSkipUncontributingPrefix(name);
15692 const size_t name_len = ImStrlen(name);
15693
15694 // Allocate chunk
15695 const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
15696 ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
15697 IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
15698 settings->ID = ImHashStr(name, name_len);
15699 memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
15700
15701 return settings;
15702}
15703
15704// We don't provide a FindWindowSettingsByName() because Docking system doesn't always hold on names.
15705// This is called once per window .ini entry + once per newly instantiated window.

Callers

nothing calls this directly

Calls 5

ImGuiWindowSettingsClass · 0.85
ImHashStrFunction · 0.85
alloc_chunkMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected