When i make a crosshair and i hide menu with 'insert' the crosshair disapears even through I am using GetBackgroundDrawList.
int m_width = ImGui::GetIO().DisplaySize.x;
int m_height = ImGui::GetIO().DisplaySize.y;
static bool Cross = false;
static bool no_recoil = false;
static bool no_spread = false;
static bool no_sway = false;
static bool no_bulletdrop = false;
static bool show_res = false;
static bool show_time = false;
if (GetAsyncKeyState(VK_DELETE) & 1) // toggle crosshair with delete key
Cross = !Cross;
if (ImGui::CollapsingHeader("Misc"))
{
if (ImGui::BeginTable("Options", 3))
{
ImGui::TableNextColumn(); ImGui::Checkbox("No Recoil", &no_recoil);
ImGui::TableNextColumn(); ImGui::Checkbox("No Spread", &no_spread);
ImGui::TableNextColumn(); ImGui::Checkbox("No Sway", &no_sway);
ImGui::TableNextColumn(); ImGui::Checkbox("No Bulletdrop", &no_bulletdrop);
ImGui::TableNextColumn(); ImGui::Checkbox("Show Resolution", &show_res);
ImGui::TableNextColumn(); ImGui::Checkbox("Show Time", &show_time);
ImGui::TableNextColumn(); ImGui::Checkbox("Crosshair", &Cross);
if (Cross)
{
ImGui::Begin("#crosshair", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar);
ImGui::GetBackgroundDrawList()->AddCircle(ImVec2(m_width / 2, m_height / 2), 6, IM_COL32(255, 0, 0, 255), 100, 0.0f);
ImGui::End();
}
// ImGui::Render(); (Causes Crash)
ImGui::EndTable();
}
}
```