Historically four major industries shaped the Texas economy prior to World War II: cattle and bison, cotton, timber, and oil. Before and after the U.S. Civil War the cattle industry, which Texas came to dominate, was a major economic driver for the state, thus creating the traditional image of the Texas cowboy. In the later 19th century cotton and lumber grew to be major industries as the cattle industry became less lucrative. It was ultimately, though, the discovery of major petroleum deposits (Spindletop in particular) that initiated an economic boom which became the driving force behind the economy for much of the 20th century.
With strong investments in universities, Texas developed a diversified economy and high tech industry in the mid-20th century. As of 2015, it is second on the list of the most Fortune 500 companies with 54.
With a growing base of industry, the state leads in many industries, including agriculture, petrochemicals, energy, computers and electronics, aerospace, and biomedical sciences. Texas has led the U.S. in state export revenue since 2002, and has the second-highest gross state product. If Texas were a sovereign state, it would be the 10th largest economy in the world.
This information cited from: https://en.wikipedia.org/wiki/Texas