If I uncomment gluBuild2DMipmaps and comment glGenerateMipmap the texture is on the cube. Why this what I'am trying is not working with GenerateMinimap ? The window is not even shown. I just can't work out this.

The texture is loaded from resource file and it is a BMP 512x512 24bpp BGR. I got OpenGL 3.1 support on ATI card.