I use the code below (really standard one):
...
glGenTextures(1, &texname);
glBindTexture(GL_TEXTURE_2D, texname);
makeTexture(); // here pixel colors are calculated
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height,
0, GL_RGB, GL_UNSIGNED_BYTE,
&image[0][0][0]); //
glEnable(GL_TEXTURE_2D);
...
glBindTexture(GL_TEXTURE_2D, texname);
drawPolygon(); // glTexCoord2 is used here in conjunction with glVertex
This code was inserted into a large visualization library. And it doesn't work there. While it works well in a small standalone application. I checked the following possible problems:
1) Incorrect texture dimensions
2) Errors after texture-related GL function calls (glGetError says it's OK).
3) Incorrect texture coordinates
It seems that everything is OK except that texture is not mapped!!! OpenGL monsters, do you have any ideas why? I work on TNT2 Pro under Win2k+SP3.



, so take it from from there.