Hi JS, I believe we should be able to remove the GLAPIENTRY entries in the glu implementation files. Do you see any potential problems with this?
Robert. On Wed, Oct 6, 2010 at 5:49 PM, Jean-Sébastien Guay <[email protected]> wrote: > Hi Robert, > >> Thanks for being quick on the ball with these changes. Hopefully >> we'll be able to get things resolved pretty quick and things compiling >> cleanly once again. > > Heh, you know me :-) > >> I did add the OSG_EXPORT which I assumed would be sufficient - this >> approach is used elsewhere in the OSG when declaring C functions. >> What is the issue that you are seeing here? The lack of direct >> mapping between glu.h and our GLU header? > > No. Look at for example src/osg/glu/libtess/tess.h. See all the GLAPIENTRY > symbols there? There are two problems there: > > 1. GLAPIENTRY is not defined anywhere. Solution: either define it, or don't > use it as a prefix anywhere. > > 2. Functions are prefixed with GLAPIENTRY in one header (tess.h) but not in > another (include/osg/GLU). VC++ requires that all predeclarations of a same > function match, as well as the definition. So you can't have a definition > like this: > > (in src/osg/glu/libutil/mipmap.cpp) > > 4587 GLint GLAPIENTRY > 4588 gluBuild2DMipmaps(GLenum target, GLint internalFormat, > 4589 GLsizei width, GLsizei height, > 4590 GLenum format, GLenum type, > 4591 const void *data) > > when you have a declaration like this: > > (in include/osg/GLU) > > 24 extern OSG_EXPORT GLint gluBuild2DMipmaps (GLenum target, GLint > internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, > const void *data); > > See there is no GLAPIENTRY in the second case, so they don't match. If you > decide to remove GLAPIENTRY as a solution to the first problem above, then > the second problem will be solved as well. > > In include/osg/GL, there is this: > > #ifndef GL_APIENTRY > #define GL_APIENTRY APIENTRY > #endif // GL_APIENTRY > > So I just added an equivalent: > > #ifndef GLAPIENTRY > #define GLAPIENTRY APIENTRY > #endif // GLAPIENTRY > > which makes things compile. But as I said, another option would be to remove > GLAPIENTRY everywhere... > >> My first priority is to get things >> compiling across platforms without the namespace - one thing at a >> time. > > I totally agree. > > Thanks for looking into the other things. I think it's the same thing as for > other GL defines that you've put in OSG directly... The GL/gl.h included > with Visual Studio doesn't have things defined in versions of OpenGL higher > than 1.1, so for example GL_TABLE_TOO_LARGE was introduced in OpenGL 1.2 > (see the bottom of http://www.opengl.org/sdk/docs/man/xhtml/glGetError.xml) > so it's not there. > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay [email protected] > http://www.cm-labs.com/ > http://whitestar02.webhop.org/ > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
