I want to change my program from gluBuild2DMipmaps to SGIS_GENERATE_MIPMAP but somehow it doesn’t work and I can’t see why.
For testing purposes the texture the min and mag filters are set to GL_NEAREST.
In fact the problem seems to be that glTexImage2d(…) does not work. The old, working code is:
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, width, height, GL_RGBA, GL_UNSIGNED_BYTE, Image);
and everything looks fine. When changing this to
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, Image);
there are no textures anymore. I thought that maybe OpenGL needs every mipmap level down to 1x1 to be defined (although i do not really think so due to examples in the red book that work without further mipmap levels), so i changed the min and mag filters to GL_NEAREST (as mentionend above). Then, i added the line
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE)
assuming that this would at least generate the neccessary mipmap levels, but still, no textures. And I cannot see what is wrong with the glTexImag2d(…) call… Can someone please help?