With the advent of the Mughals in 1526 , Delhi alternated with Agra as the capital , and each ruler asserted his particular taste in architectural caprice .
Delhi and Agra took turns being the capital after 1526 .