Question: And when did it start being used that way? Before or after the bird meaning of "rook"?

Answer: 
[etymonline.com](http://www.etymonline.com/index.php?term=rook)

> 
> "chess piece," c.1300, from O.Fr. roc,
>  from Arabic rukhkh, from Pers. rukh,
>  of unknown meaning, perhaps somehow
>  related to the Indian name for the
>  piece, rut, from Hindi rath "chariot."
> 
> 
> 

According to the OED, the word rook meaning the bird was first used circa 725.

So it seems that the two words have different origins.
The rook is definitely named from the Persian word rukh meaning war-chariot as the corresponding piece in Oriental games is also called a chariot. However as the game came to Europe the word got confused with the Italian word rocca meaning a tower. That's why it's represented as a fortified tower and referred to informally as a castle. Nothing to do with the bird.