Skip to content

Commit

Permalink
Added flags to skip window rendering for subsequent access to drawLists.
Browse files Browse the repository at this point in the history
The flags are ImGuiWindowFlags_NoBackground/NoWindow. They make it easier to create an invisible window for drawing texts outside of imgui via raw access to the draw lists as suggested in ocornut#628.
  • Loading branch information
biojppm committed Mar 4, 2018
1 parent df8a9c4 commit d48a393
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5928,10 +5928,11 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
RenderFrame(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, true, window_rounding);
g.Style.FrameBorderSize = backup_border_size;
}
else
else if((window->Flags & ImGuiWindowFlags_NoWindow) != ImGuiWindowFlags_NoWindow)
{
// Window background
ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags));

if (g.NextWindowData.BgAlphaCond != 0)
{
bg_col = (bg_col & ~IM_COL32_A_MASK) | (IM_F32_TO_INT8_SAT(g.NextWindowData.BgAlphaVal) << IM_COL32_A_SHIFT);
Expand Down
2 changes: 2 additions & 0 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // (WIP) Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui.
ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window
ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
ImGuiWindowFlags_NoBackground = 1 << 20, // Do not draw background for this window
ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
ImGuiWindowFlags_NoWindow = ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoInputs,

// [Internal]
ImGuiWindowFlags_NavFlattened = 1 << 23, // (WIP) Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
Expand Down

0 comments on commit d48a393

Please sign in to comment.