First, prepare the six images of the cube map. In this example, the images will have the following naming convention. There is a base name (stored in the baseFileName variable) followed by an underscore, followed by one of the six possible suffixes (posx, negx, posy, negy, posz, or negz), followed by the file extension. The suffixes posx, posy, and so on, indicate the axis that goes through the center of the face (positive x, positive y, and so on).
Make sure that they are all square images (preferably with dimensions that are a power of two), and that they are all the same size.
Set up your OpenGL program to provide the vertex position in attribute location 0, and the vertex normal in attribute location 1.
This vertex shader ...