For the pistol question: You cannot, at 18, purchase a pistol from a FFL (Federal Firearms Licensee), per federal statute you must be 21. However, depending on the specific laws in your state of residence, you may be able to purchase one from an individual. It would take me a bit to find the specific citation, but I am 99% sure an 18 year old can possess and own a pistol, depending on the laws of your state.
For example: My daughter is 19, because of Federal statutes she cannot go to the local gun shop and purchase a pistol. However, she can legally purchase a pistol from my neighbor and be within the letter of the law. In the case of TX, you can also make your purchases like this, at age 18.
For the rifle: You are clear to own, possess and purchase a rifle at 18, unless there are laws specific to your state, and from my research there are no laws in TX forbidding an 18 year old from possessing, owning, or purchasing (in a private or face-to-face sale).
The process is simple. In scenario 1 you walk into Wal-Mart, see a gun you want, fill out some paperwork (ATF Form 4473), wait for the background check, and if there is no waiting period in your state, you walk out the door with your newly purchased firearm. There is, to the best of my knowledge, no mandatory registration in TX.
In scenario 2 you find someone who is selling a gun you want to buy, you give them cash, they give you the gun. This is called a "Face-to-face" sale and in most states (including TX) it is perfectly legal.
The third scenario (rifle/shotgun only!) is you find a gun you like on an online site (gunbroker.com for example), you bid, win the auction, have the rifle/shotgun shipped to a local gun shop (pre-arrange the shipping, some gun shops will charge extra for doing a transfer this way), then you would follow the steps in scenario 1.
I'm sure there will be others that can give more specific information regarding your specific state laws.
You could also go here:
http://www.texasguntalk.com/forums/forum.phpEverything I wrote is contingent on you NOT being a prohibited person as defined by the federal laws and the laws of your state.