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?

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).]

Originally posted by yakuza:
[b]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.”
[/b]

Ok, that solved the 2nd two lines, but the 1st one (the most important one) still plagues me . Any ideas?

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

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…