PDA

View Full Version : Help , texture problem



Turn right
06-13-2004, 03:15 PM
TexBits = LoadDIBitmap("24.bmp", &TexInfo);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

glTexImage2D(GL_TEXTURE_2D, 0, 3, TexInfo->bmiHeader.biWidth, TexInfo->bmiHeader.biHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, TexBits);
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glPushMatrix();
glTranslatef(0.0, 0.0, -50.0);

glColor3f(1.0, 1.0, 1.0);
glutSolidTeapot(10.0);

glPopMatrix();

why they can.t be displayed, any problem?

06-13-2004, 07:45 PM
good intro to texture mapping, should be helpful
http://fly.cc.fer.hr/~unreal/theredbook/chapter09.html