MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / AddDrawCmd

Method AddDrawCmd

ImGUI GLFW Tutorial/imgui/imgui_draw.cpp:451–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void ImDrawList::AddDrawCmd()
452{
453 ImDrawCmd draw_cmd;
454 draw_cmd.ClipRect = _CmdHeader.ClipRect; // Same as calling ImDrawCmd_HeaderCopy()
455 draw_cmd.TextureId = _CmdHeader.TextureId;
456 draw_cmd.VtxOffset = _CmdHeader.VtxOffset;
457 draw_cmd.IdxOffset = IdxBuffer.Size;
458
459 IM_ASSERT(draw_cmd.ClipRect.x <= draw_cmd.ClipRect.z && draw_cmd.ClipRect.y <= draw_cmd.ClipRect.w);
460 CmdBuffer.push_back(draw_cmd);
461}
462
463// Pop trailing draw command (used before merging or presenting to user)
464// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL

Callers 2

MergeMethod · 0.45
SetCurrentChannelMethod · 0.45

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected