One may well ask, if the button fly preceded the zipper, and the codpiece preceded the button fly, what preceded the codpiece? The answer is, quite literaly, nothing. Leather leggings, the antecedents of Renaissance hosiery, were merely tubes of animal skins held on by strips of leather and connected together rather perfunctorily at the top. In fact, the crotch was most often left almost completely open, for ease of access during those "privy" functions. One was protected from exposure of one's "person" by tunics which reached the knees or beyond.
However, with the rise of the merchant class at the beginning of the Renaissance, came "Fashion Trends". Clothing for the poor remained functional, of course, but for the wealthy, changing one's fashion to follow, or build on, a social trend became a way of displaying one's wealth, and for men, one's masculinity. With the use of the newly popular button, fashions became more fitted and tight to the body, (no need to cut a garment loose so that it could fit over one's head). Thus, the popular look became long, elegant, and youthful.
To achieve this look to an even greater degree, the waistline of the tunic was dropped to the hips to make the body look longer, and the hemline was shortened to make the legs look longer. By 1360 men's hems rose to mid-thigh. This was a shocking event indeed, considering that the basic design of men's hosiery had not changed. When a man sat, or mounted a horse, one might have quite a "regimental" view of his state of affairs. The clergy, (those who were not themselves following the fashion), as well as other guardians of public morals, were up in arms. In Chaucer's "Canterbury Tales" the Parson criticizes these short garments for their revealing nature:
Alas! some of them show the very boss of the penis and the horrible pushed-out testicles that look like the malady of hernia in the wrapping of their hose, and the buttocks of such persons look like the hinder parts of a she-ape in the full of the moon. And moreover, the hateful proud members that they show by the fantastic fashion of making one leg of their hose white and the other red, make it seem that half of their privy members are flayed. And if it be that they divide their hose in other colours, as white and black, or white and blue, or black and red, and so forth, then it seems, by the variation of colour, that the half of their privy members are corrupted by the fire of Saint Anthony, or by cancer, or by other such misfortune.
During the years 1420-40 tunic hemlines reached the top of the thigh and "the occasional glimpse of the male sexual organs that had caused such an outcry in the fourteenth century was now replaced by the permanent exposure of that zone". (From "Fashions for Men, An Illustrated History", by Diana de Marly, pub. Holmes and Meier, 1989).
The next fashion trend was to go about in one's hose and shirt, (the shirt being what we think of as a doublet with a chemise worn underneath), sans the tunic. Measures had to be taken! (Please pardon the pun.) In 1482 Edward IV introduced a law which forbade persons below the rank of Lord to expose their private parts by short doublets. People ignored it. Finally the public outcry became too fierce, and, since men would certainly not be inconvenienced by simply sewing the crotch seam shut, the codpiece was invented.
To begin with, it was simply a triangular piece of fabric tied at the three corners, or stitched at the bottom angle and tied at the top two angles, over the gap in the front of the hose. However, men quickly discovered, as they are wont to do, that what might have been revealed before as somewhat lacking in size and stature, could be easily artificially enhanced under the masque of this new fashion. Over the next century, the codpiece developed from a flat piece of fabric, to a pouch in which the "family jewels" rested in as protruding a manner as possible, to a padded pouch, to a very padded pouch, (some of them very oddly shaped), until finally the pouch idea was discarded altogether, along with any pretense to function, and large padded shapes of bizarre dimensions were tied onto either hose or shirt, the "items of value" simply residing behind these bombastic shapes.
Guidelines for the shapes of codpieces at various points in history may be broad, but, as a general rule, codpieces started out triangular and flat, progressed to a loaf shape during the reign of Henry VIII, and then developed into an elongated oval shape that poked out temptingly from the folds and panes of the puffy trunk hose during early Elizabethan times, with the Spanish court, in 1550, bursting with virile pride over their conquests in the New World, sporting codpieces which portrayed, as it seemed, permanent erections. Even though the increasing puffiness of canions and venetions seems to preclude the necessity for codpieces as a means of "covering the sinful parts", this harbinger of virility continued in fashion until about 1580, and then seems to disappear into the ever more voluminous folds of the trunk hose.