An extension of Dear ImGui that adds notifications. Fork of imgui-notify by TyomaVader.
To add this library to your project, simply add these three lines to your CMakeLists.txt and replace path/to/imgui with the path to the imgui folder :
add_subdirectory(path/to/ImGuiNotify)
target_include_directories(ImGuiNotify SYSTEM PRIVATE path/to/imgui)
target_link_libraries(${PROJECT_NAME} PRIVATE ImGuiNotify::ImGuiNotify)Then include it as:
#include "ImGuiNotify/ImGuiNotify.hpp"Once, after initializing ImGui, you must call ImGuiNotify::add_icons_to_current_font(). Call this after you add your custom fonts. Or if you don't use custom fonts then do this :
ImGui::GetIO().Fonts->AddFontDefault();
ImGuiNotify::add_icons_to_current_font();NB: if you are using custom fonts you might have to pass an
icon_sizeand / or aglyph_offsetif the icons aren't aligned with your font.
Every frame, before calling ImGui::Render(), you must call
ImGuiNotify::render_windows();Then, to create notifications :
ImGuiNotify::send({
.type = ImGuiNotify::Type::Success,
.title = "Success",
.content = "Hello",
});