MCPcopy Create free account
hub / github.com/RenderKit/embree / CreateNewWindowSettings

Method CreateNewWindowSettings

tutorials/common/imgui/imgui.cpp:12350–12370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12348}
12349
12350ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
12351{
12352 ImGuiContext& g = *GImGui;
12353
12354#if !IMGUI_DEBUG_INI_SETTINGS
12355 // Skip to the "###" marker if any. We don't skip past to match the behavior of GetID()
12356 // Preserve the full string when IMGUI_DEBUG_INI_SETTINGS is set to make .ini inspection easier.
12357 if (const char* p = strstr(name, "###"))
12358 name = p;
12359#endif
12360 const size_t name_len = strlen(name);
12361
12362 // Allocate chunk
12363 const size_t chunk_size = sizeof(ImGuiWindowSettings) + name_len + 1;
12364 ImGuiWindowSettings* settings = g.SettingsWindows.alloc_chunk(chunk_size);
12365 IM_PLACEMENT_NEW(settings) ImGuiWindowSettings();
12366 settings->ID = ImHashStr(name, name_len);
12367 memcpy(settings->GetName(), name, name_len + 1); // Store with zero terminator
12368
12369 return settings;
12370}
12371
12372ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id)
12373{

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