Results 1 to 4 of 4

Thread: Texture problems

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    Florida
    Posts
    15

    Texture problems

    Getting errors from OpenGL about some lines I'm running from a tutorial site - hoping someone could shed some light on this. The lines causing the problem are:

    gluBuild2DMipmaps (GL_TEXTURE_2D, O.GetChannels (), O.GetTexWidth (), O.GetTexHeight (),
    GL_BGR_EXT, GL_UNSIGNED_BYTE, O.GetPixelData ());

    glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
    , and

    glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);

    The error msg I'm receiving is:

    GL Reports: Invalid Enum!

    This is pulled from the glGetError () function, which is from openGL itself...so I must be doing something wrong . Any ideas why those lines could cause that problem?
    The great pop-tart GAWD of Mt. Kellogs

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Texture problems

    I'm pretty sure that's an invalid mode for your magnification filtering method, try GL_LINEAR instead of GL_LINEAR_MIPMAP_LINEAR

    Hope that helps.

    edit: From the Redbook: "With magnification, even if you've supplied mipmaps, the base level texture map is always used."

    [This message has been edited by yakuza (edited 11-16-2002).]

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    Florida
    Posts
    15

    Re: Texture problems

    Originally posted by yakuza:
    I'm pretty sure that's an invalid mode for your magnification filtering method, try GL_LINEAR instead of GL_LINEAR_MIPMAP_LINEAR

    Hope that helps.

    edit: From the Redbook: "With magnification, even if you've supplied mipmaps, the base level texture map is always used."
    Ok, that solved the 2nd two lines, but the 1st one (the most important one) still plagues me . Any ideas?
    The great pop-tart GAWD of Mt. Kellogs

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Texture problems

    You only needed to make the change for the magnification, not minification.

    Code :
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    gluBuild2DMipmaps(*);
    Is GL_BGR_EXT supported by your card? There's not much else I can think of...

Similar Threads

  1. Problems Texture Mapping with Float Texture
    By CelticBlues in forum OpenGL: GLSL
    Replies: 21
    Last Post: 02-08-2009, 04:13 AM
  2. More texture problems: here we go....again!
    By gui24a in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 08-25-2008, 12:30 PM
  3. Texture Problems ...
    By Saintex in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 07-22-2002, 07:38 AM
  4. Texture Problems
    By spectrum in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 01-09-2002, 02:58 AM
  5. AVI texture problems
    By dmsy in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-12-2000, 01:09 PM

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