The often ''misunderstood' component of Mid to Late Medieval Clothing (and well into The Renaissance Era), The Codpiece is more of a ''fashion statement'' rather than a functional piece of clothing for The Male. What ''ancient painting'' doe not show some Gentle or Nobleman with what appears to be an ''overreaching'' piece of fabric ''attached'' to His ''frontside''? And most (today) - ask ''Why''. Simply put, The Codpiece was a cup shaped cloth, either attached via hooks or straps of cloth (among other types of material), to the front of a Man's Hose or Trousers. They were originally designed to conceal any obvious ''bulges'' and seen as more ''modesty'' than ''brag''.
But in type, many Men wore such components to ''accentuate'' rather than ''conceal''. some varieties were later even shaped to resemble just exactly ''what'' the Codpiece was meant to conceal. By this time, (16th Century), such Codpieces were seen as Fashion vogue (as it were), boasting of a Man's ''virility''. Often made of matching or varigated coloring, Codpieces were also made of garish and colorful materials or related. For a period of time, even ''Fighting Armor'' (really ceremonial, at best) - featured rather ''robust'' versions of Codpieces.