MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / SetupViewportDrawData

Function SetupViewportDrawData

plugins/Cardinal/src/DearImGui/imgui.cpp:4412–4428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4410}
4411
4412static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVector<ImDrawList*>* draw_lists)
4413{
4414 ImGuiIO& io = ImGui::GetIO();
4415 ImDrawData* draw_data = &viewport->DrawDataP;
4416 draw_data->Valid = true;
4417 draw_data->CmdLists = (draw_lists->Size > 0) ? draw_lists->Data : NULL;
4418 draw_data->CmdListsCount = draw_lists->Size;
4419 draw_data->TotalVtxCount = draw_data->TotalIdxCount = 0;
4420 draw_data->DisplayPos = viewport->Pos;
4421 draw_data->DisplaySize = viewport->Size;
4422 draw_data->FramebufferScale = io.DisplayFramebufferScale;
4423 for (int n = 0; n < draw_lists->Size; n++)
4424 {
4425 draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size;
4426 draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size;
4427 }
4428}
4429
4430// Push a clipping rectangle for both ImGui logic (hit-testing etc.) and low-level ImDrawList rendering.
4431// - When using this function it is sane to ensure that float are perfectly rounded to integer values,

Callers 1

RenderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected