PDA

View Full Version : Texture problems



KShots
11-16-2002, 07:08 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif. Any ideas why those lines could cause that problem?

yakuza
11-16-2002, 07:10 AM
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).]

KShots
11-16-2002, 07:28 AM
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 http://www.opengl.org/discussion_boards/ubb/frown.gif. Any ideas?

yakuza
11-16-2002, 07:40 AM
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...