MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / CreateNewWindowSettings

Method CreateNewWindowSettings

extern/imgui/imgui.cpp:13086–13106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13084}
13085
13086ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
13087{
13088 ImGuiContext& g = *GImGui;
13089
13090#if !IMGUI_DEBUG_INI_SETTINGS
13091 // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
13092 // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier.
13093 if (const char* p = strstr(name, "###"))
13094 name = p;
13095#endif
13096 const size_t name_len = strlen(name);
13097
13098 // Allocate chunk
13099 const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
13100 ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
13101 IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
13102 settings->ID = ImHashStr(name, name_len);
13103 memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
13104
13105 return settings;
13106}
13107
13108ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id)
13109{

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected