Original Post
I am trying to apply a cube map to a sphere with not much success...I wrote this code based on a couple of different samples that were doing roughly the same thing This loads the cubemap texture...
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
glGenTextures(1,&envText);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, envText);
//Create the name to be loaded
sprintf(buff, string, "posx");
iResult = kTextureSystem.loadTexture(buff);
applyTexture(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,kTextureSystem.getBitmapPointer(buff));
sprintf(buff, string, "negx");
iResult = kTextureSystem.loadTexture(buff);
applyTexture(GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,kTextureSystem.getBitmapPointer(buff));
sprintf(buff, string, "posy");
iResult = kTextureSystem.loadTexture(buff);
applyTexture(GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,kTextureSystem.getBitmapPointer(buff));
sprintf(buff, string, "negy");
iResult = kTextureSystem.loadTexture(buff);;
applyTexture(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,kTextureSystem.getBitmapPointer(buff));
sprintf(buff, string, "posz");
iResult = kTextureSystem.loadTexture(buff);
applyTexture(GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,kTextureSystem.getBitmapPointer(buff));
sprintf(buff, string, "negz");
iResult = kTextureSystem.loadTexture(buff);
applyTexture(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,kTextureSystem.getBitmapPointer(buff));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
This uses the texture to draw a sphere
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
//Set type of auto generation of tex-coords
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_ARB);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_ARB);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_ARB);
//Enable auto generation of tex-coords
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R);
//
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
//load the texture
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB,envText);
//Switch to texture coordinate mode
glMatrixMode(GL_TEXTURE);
//Draw something
glutSolidSphere(50.0, 100, 100);
glMatrixMode(GL_MODELVIEW);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
Anything obvious missing...all I get is a grey sphere???