For some reason, if I use mipmapping, I can see my textures, but if I don’t use mipmapping, they all show up white. Here’s the code I used to display them using mipmapping:
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
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);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, tile_width, tile_height, GL_RGBA, GL_UNSIGNED_BYTE, gfx_data);
If I replace that last line with the following:
glTexImage2D(GL_TEXTURE_2D, 0, 4, tile_width, tile_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx_data);
Then all my images appear white. Any clue as to what I’m doing wrong? Thanks for your help.