|
|
|
@ -417,6 +417,12 @@ ImGuiStyle::ImGuiStyle() |
|
|
|
|
Colors[ImGuiCol_TooltipBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// We statically allocate a default font storage for the user.
|
|
|
|
|
// This allows the user to avoid newing the default font, while keeping IO.Font a pointer which is easy to swap if needed.
|
|
|
|
|
// We cannot new() the font because user may override MemAllocFn after the ImGuiIO() constructor is called.
|
|
|
|
|
// For the same reason we cannot call LoadDefault() on the font.
|
|
|
|
|
static ImFont GDefaultStaticFont; |
|
|
|
|
|
|
|
|
|
ImGuiIO::ImGuiIO() |
|
|
|
|
{ |
|
|
|
|
memset(this, 0, sizeof(*this)); |
|
|
|
@ -425,7 +431,7 @@ ImGuiIO::ImGuiIO() |
|
|
|
|
IniSavingRate = 5.0f; |
|
|
|
|
IniFilename = "imgui.ini"; |
|
|
|
|
LogFilename = "imgui_log.txt"; |
|
|
|
|
Font = NULL; |
|
|
|
|
Font = &GDefaultStaticFont; |
|
|
|
|
FontGlobalScale = 1.0f; |
|
|
|
|
FontAllowUserScaling = false; |
|
|
|
|
PixelCenterOffset = 0.0f; |
|
|
|
@ -1662,9 +1668,12 @@ void ImGui::Shutdown() |
|
|
|
|
g.LogFile = NULL; |
|
|
|
|
} |
|
|
|
|
if (g.IO.Font) |
|
|
|
|
{ |
|
|
|
|
if (g.IO.Font != &GDefaultStaticFont) |
|
|
|
|
{ |
|
|
|
|
g.IO.Font->~ImFont(); |
|
|
|
|
ImGui::MemFree(g.IO.Font); |
|
|
|
|
} |
|
|
|
|
g.IO.Font = NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|