我正在尝试将纹理加载到由 glutSolidSphere 和 soil.lib 创建的球体中
这就是我正在尝试的:
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);
我认为我正在失去一些东西,但我没有什么。
谢谢。