Skip to content

Coollab-Art/ImGuiNotify

 
 

Repository files navigation

ImGuiNotify

An extension of Dear ImGui that adds notifications. Fork of imgui-notify by TyomaVader.

Demo

Including

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"

Using

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_size and / or a glyph_offset if 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",
});

About

An extension of Dear ImGui that adds notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.6%
  • C++ 3.0%
  • CMake 0.4%