我有一个应该显示图像但图像永远不会出现的以下代码。
GLuint tex_2d = SOIL_load_OGL_texture (
"ImageName.tga",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
glColor3f(0.0f,1.0f,.50f);
glBindTexture(GL_TEXTURE_2D, tex_2d);
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glTexCoord2d(0,0); glVertex3f(factor*BOARD_BREADTH/2,-factor*BOARD_LENGTH/2,0);
glTexCoord2d(0,1); glVertex3f(factor*BOARD_BREADTH/2,factor*BOARD_LENGTH/2,0);
glTexCoord2d(1,1); glVertex3f(-factor*BOARD_BREADTH/2,factor*BOARD_LENGTH/2,0);
glTexCoord2d(1,0); glVertex3f(-factor*BOARD_BREADTH/2,-factor*BOARD_LENGTH/2,0);
glEnd();
但我只得到一个绿色矩形作为输出。没有编译错误。