Clean up code, move to glTexStorage2D.