glActiveTexture and GL_TEXTURE*

Hi all,

I have been working under linux using eclipse, gcc, opengl and cg. The program uses glActiveTexture with a GL_TEXTURE* as a parameter and runs correctly.

I’m trying to make the same program work under windows, still using eclipse, gcc, opengl and cg. After the first compile it couldn’t find any of GL_TEXTURE* or glActiveTexture, even though all the other opengl functions worked fine.

I included glext.h ( even though i didn’t need it under linux ) and it was able to find all GL_TEXTURE* but not glActiveTexture.

Is there something special about glActiveTexture under Windows ? Why do I have to include glext.h under windows and not linux ?

Thankyou

Those libraries are made by the the driver developers and Microsoft, so they can decide how to expose the different drivers. glActiveTexture was an extension at some point and I guess at some point some developer decided to move it to a different file.

hmmm :-s.

I set out looking for where glActiveTexture might have been moved. To my suprise I found it in gl.h, along with all the GL_TEXTURE*s (where it should be :-)). This defies my logic, as I would think that including gl.h should do the job (my problem is not a link error).

ok, found it !

I had missed this during my first look in gl.h :

/* Under Windows, we do not define OpenGL 1.2 & 1.3 functionality, since it is treated as extensions (defined in glext.h) */

So I had a better look in glext.h and found glActiveTexture, I then saw this little whippersnapper :

#ifdef GL_GLEXT_PROTOTYPES

So I defined GL_GLEXT_PROTOTYPES in my project and that got rid of the compile errors.

But, as usual, one train hides another and a compile error hides a link error :-).

This was more ( but at the same time less ) complicated than I thought…I was looking for something like libGLext.a, but I couldn’t find it.

I found out that GLee did the exact job I wanted to do so I just downloaded it from the opengl.org and included it insted of including gl.h and glext.h. I don’t need to define GL_GLEXT_PROTOTYPES anymore either.

So everything is hunky. Don’t quite understand it all ( and if anyone would like to explain that would be cool ) but I think thankyou GLee is in order.

Thanks for the reply strattonbrazil, it put me on the right track.

Code on !

Explanations here :
http://www.opengl.org/wiki/Getting_started#OpenGL_2.0.2B_and_extensions

Simple solution : use GLee or GLEW.

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