When the war for mexican independence ended in 1812, the area of texas was a) part of spain b) part of mexico c) and independent country d) a territory of the united states