Columns: Clipping columns borders on Y axis on CPU because some GPU drivers appears to be unhappy with triangle spanning large regions (not sure why tbh). (#125)

Demo: Columns: Adding a billion of extra lines and using clipper.
This commit is contained in:
omar
2017-11-14 22:40:57 +01:00
parent 0858c3d7cb
commit 6001d9c7a4
2 changed files with 14 additions and 8 deletions

View File

@ -1652,14 +1652,19 @@ void ImGui::ShowTestWindow(bool* p_open)
if (ImGui::TreeNode("Horizontal Scrolling"))
{
ImGui::SetNextWindowContentWidth(1500);
ImGui::BeginChild("##scrollingregion", ImVec2(0, 120), false, ImGuiWindowFlags_HorizontalScrollbar);
ImGui::BeginChild("##ScrollingRegion", ImVec2(0, ImGui::GetFontSize() * 20), false, ImGuiWindowFlags_HorizontalScrollbar);
ImGui::Columns(10);
for (int i = 0; i < 20; i++)
for (int j = 0; j < 10; j++)
{
ImGui::Text("Line %d Column %d...", i, j);
ImGui::NextColumn();
}
int ITEMS_COUNT = 2000;
ImGuiListClipper clipper(ITEMS_COUNT); // Also demonstrate using the clipper for large list
while (clipper.Step())
{
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
for (int j = 0; j < 10; j++)
{
ImGui::Text("Line %d Column %d...", i, j);
ImGui::NextColumn();
}
}
ImGui::Columns(1);
ImGui::EndChild();
ImGui::TreePop();