Hamilton made 11-of-16 shots, including 5-of-8 from 3-point range.
The Longhorns (19-3, 5-2 Big 12) broke away with the second-half run that featured four baskets, including three 3-pointers, by Hamilton.
Damion James added 14 points for Texas.
Oklahoma State's James Anderson was the game's leading scorer with 28 points. Obi Muonelo scored 12 points and Matt Pilgrim had 11 for the Cowboys (16-6, 4-4).