while you could do this in code, the best way to do this is to use unwrap3d to unwrap a cube mesh and paint the 6 sides on a single texture...
I just did it. the new unwrap3d has a cube primitive built in www.unwrap3d.com
I just did it. the new unwrap3d has a cube primitive built in www.unwrap3d.com