1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-11 07:26:05 +01:00

Internals: Exposed SetCurrentFont() in imgui_internal.h

This commit is contained in:
omar 2018-01-12 20:07:01 +01:00
parent c85d7d6e49
commit db63e71f13
2 changed files with 3 additions and 2 deletions

View File

@ -674,7 +674,6 @@
static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true); static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true);
static ImFont* GetDefaultFont(); static ImFont* GetDefaultFont();
static void SetCurrentFont(ImFont* font);
static void SetCurrentWindow(ImGuiWindow* window); static void SetCurrentWindow(ImGuiWindow* window);
static void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x); static void SetWindowScrollX(ImGuiWindow* window, float new_scroll_x);
static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y); static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y);
@ -6220,7 +6219,7 @@ static ImFont* GetDefaultFont()
return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0];
} }
static void SetCurrentFont(ImFont* font) void ImGui::SetCurrentFont(ImFont* font)
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ? IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?

View File

@ -996,6 +996,8 @@ namespace ImGui
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
IMGUI_API void PopItemFlag(); IMGUI_API void PopItemFlag();
IMGUI_API void SetCurrentFont(ImFont* font);
IMGUI_API void OpenPopupEx(ImGuiID id); IMGUI_API void OpenPopupEx(ImGuiID id);
IMGUI_API void ClosePopup(ImGuiID id); IMGUI_API void ClosePopup(ImGuiID id);
IMGUI_API bool IsPopupOpen(ImGuiID id); IMGUI_API bool IsPopupOpen(ImGuiID id);