Greetings:
The code below works fine if I uncomment gluBuild2DMipmaps() and comment out glGenerateMipmap(). But the way it is, trying to use glGenerateMipmap() to generate mipmaps, doesn’t work. It seems to replace the texture with a black image. Btw, my PC supports 3.3.
Any idea what I am doing wrong?
Thanks,
Sam
glBindTexture(GL_TEXTURE_2D, texture[2]);
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_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, image[0]->sizeX, image[0]->sizeY,
// GL_RGB, GL_UNSIGNED_BYTE, image[0]->data);
glGenerateMipmap(GL_TEXTURE_2D);