glgeneratemipmap()didn't run correctly

hey,I’m reading OpenGL SB 5ed recently,when I run the example in chapter 5 about mipmap,the example crashed on my laptop under window 7.I found the function glgeneratemipmap() didn’t work,just black screen.and I also can’t step into this function(why?).However,I just comment out this function in the code,then it works,but without any mipmap effect.I think this problem maybe caused by my intel graphic card(GM 4 series),because I got some other problems previously solved by upgrade the graphic card driver.I wonder is there any other solutions?upgrading driver will not work any more since I have the latest driver installed.
by the way,I worked both under windows and linux.Strangely,I also run that example in gentoo linux, it works well.I know little about OpenGL under linux.
thanks for any reply:)

Requires GL 3.0
and it requires creation of a GL 3.0 context
examples are here for making gl 3

This is nothing to do with the OS, it’s entirely down to the graphics card driver, and if that doesn’t support glGenerateMipmap (or if it has a botched implementation of it) then it won’t work.

my intel graphic card(GM 4 series)

I think we’ve found the cause of your problem.

if (IntelGraphics + OpenGL == (GOOD & RELIABLE))
        Hell->FreezeOver ();

Could u try this add


before the glewInit() call and see if this helps.

hey,mobeen,adding your code doesn’t work.

V-man,I didn’t understand what GL3.0 context is for.

intel card…hmm,it’s really bad luck:(

glGenerateMipmap requires a GL 3.0 context.
If you have <3.0, then you use the old method.

3.0 context or the extension GL_ARB_framebuffer_object which any sane gl 2.0 context should provide :wink:

I stumbled across this issue recently. I tried this


But on my ATI card all mipmaps came out black. In the end I just used good old gluBuildMipmaps2d. Older hardware seems to much prefer the power of 2 mipmaps it generates :stuck_out_tongue:

if it is about power of two, it is better to resample the image separately to power of two, you can get better results than the crude job done by gluBuildMipmaps2d.