Results 1 to 9 of 9

Thread: glgeneratemipmap()didn't run correctly

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    18

    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

  2. #2
    V-man
    Guest

    Re: glgeneratemipmap()didn't run correctly

    Requires GL 3.0
    and it requires creation of a GL 3.0 context
    examples are here for making gl 3
    http://www.opengl.org/wiki/Tutorials

  3. #3
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,789

    Re: glgeneratemipmap()didn't run correctly

    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.
    Code :
    if (IntelGraphics + OpenGL == (GOOD & RELIABLE))
            Hell->FreezeOver ();

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: glgeneratemipmap()didn't run correctly

    Could u try this add
    Code :
    glewExperimental=GL_TRUE;
    before the glewInit() call and see if this helps.
    Regards,
    Mobeen

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    18

    Re: glgeneratemipmap()didn't run correctly

    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

  6. #6
    V-man
    Guest

    Re: glgeneratemipmap()didn't run correctly

    glGenerateMipmap requires a GL 3.0 context.
    If you have <3.0, then you use the old method.
    http://www.opengl.org/wiki/Common_Mi...map_generation

  7. #7
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: glgeneratemipmap()didn't run correctly

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

  8. #8
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    258

    Re: glgeneratemipmap()didn't run correctly

    I stumbled across this issue recently. I tried this

    glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

    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

  9. #9
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: glgeneratemipmap()didn't run correctly

    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.

Similar Threads

  1. GL didn't work in OSX, but in Windows
    By hesheit in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 10-08-2013, 09:30 AM
  2. Replies: 2
    Last Post: 04-01-2012, 02:27 AM
  3. Wow, I didn't know this would come out like it did...
    By grady in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-23-2001, 12:34 PM
  4. I didn't even get started!
    By Ghitza in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-20-2001, 12:18 PM
  5. Culling on even if I didn't turn it on?
    By Caesar in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-21-2000, 11:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean