Updated texture class to handle internal and pixel formats well.