I'm trying to load a texture into a sphere created by glutSolidSphere with soil.lib
This is what i'm trying:
GLuint texture[1];
/* load an image file directly as a new OpenGL texture */
texture[0] = SOIL_load_OGL_texture("Terra.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y);
printf("%d ", texture[0]);
if (texture[0] == 0) {
printf("Error loading texture \n");
return 0;
}
// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glutSolidSphere(20, 20, 20);
I think that I´m losing something, but i don't no what.
Thanks.