As others have noted, identifying the particular state in question would help a lot in narrowing answers to this question.
In Maryland, for example, a handgun must be in a enclosed case, unloaded, and are only "transporting the handgun to or from the places listed in section 4-203 of the Criminal Law Article of the Annotated Code of Maryland" (i.e. - "a target shoot, formal or informal target practice, sport shooting event, hunting, a Department of Natural Resources-sponsored firearms and hunter safety class, trapping, or a dog obedience training class or show." Yeah, that last one has had me scratching my head for years). In MD, and enclosed case does not mean the glove compartment, but rather an enclosed case, within the trunk, unloaded.
In neighboring Virginia, as was pointed out, the glove compartment will work, loaded or unloaded.
And, regardless of what the code actually says in the District of Columbia, the PD will usually have their own more restrictive interpretation...