View Full Version : glActiveTexture and GL_TEXTURE*
04-12-2010, 04:46 AM
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 ?
04-12-2010, 11:22 AM
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.
04-13-2010, 01:29 AM
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).
04-13-2010, 01:44 AM
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 :
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 :-).
04-13-2010, 02:18 AM
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 !
04-13-2010, 06:23 AM
Explanations here :
Simple solution : use GLee or GLEW.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.