|
我用 gluSphere()函数画了个球体,并且用 gluQuadricTexture()这个函数自动生成了纹理坐标,结果只是有个一个球,并没有贴图。在这之前载入了一个512*512像素的BMP图片(载入成功),下面是加载位图、创建并指定纹理对象的部分代码,请大家帮我分析问题处在哪呢?????
LoadGLTextures()
{
int Status=FALSE;
AUX_RGBImageRec* TextureImage[1];
memset(TextureImage,0,sizeof(void*)*1);
if (TextureImage[0]=LoadBMP("st1.bmp"))
{
Status=TRUE;
glGenTextures(1,&m_texture[0]);
glBindTexture(GL_TEXTURE_2D,m_texture[0]);
glTexImage2D(GL_TEXTURE_2D,
0,
3,
TextureImage[0]->sizeX,
TextureImage[0]->sizeY,
0,
GL_RGB,
GL_UNSIGNED_BYTE,
TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
[em1] [em1] [em1] [em1] |
|