Incorrect OGL header / sdk / XCode framework?

I’m trying to figure out why a rewrite of a GLUT based OGL application is giving me a gl error of ‘invalid enumerant’ on a call of ‘glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR )’.

The original application was written in the XCode IDE, in Objective C, in an OS X 10.4 environment. The new version is in pure C++, but is essentially the same OGL logic and same OGL code called in the same order as previously.

The same machine the original program was authored on was recently upgraded to OS X 10.6.4 and XCode 3.2.2. However, I do not know if that OS upgrade included any reinstall or update of the GLUT.framework or OpenGL.framework headers and libraries.

The call generating the gl error was tracked down by sprinkling the code with glGetError() calls until the above glTexParameteri() was identified. It’s location is fairly early in the program, not long after glutInit(&argc,argv), glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH ), and other typical initializations.

The specific section of code is:
// make that image a texture:
GLuint texture;
glGenTextures( 1, &texture );
glErrorReport( (char *)“texture step 1…” );
glBindTexture( GL_TEXTURE_2D, texture );
glErrorReport( (char *)“texture step 2…” );
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
glErrorReport( (char *)“texture step 3…” );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR );
glErrorReport( (char *)“texture step 4…” );

with the error being generated right at “texture step 4”.

So I’m wondering if my compile/sdk/libraries are screwed up…

Where would I check to verify I have the right OGL headers and libraries for OS X 10.6.4?

GL_LINEAR is an invalid for the enum. It has to be GL_REPEAT, GL_CLAMP_TO_EDGE, etc.

To set the filtering you use: (assuming no mipmaps)

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

You’re right. I must have copied code wrong. Duh. Thanks!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.