On Thu, 24 Feb 2000, Mark Kilgard wrote:
> I have one concern about <GL/glext.h>.
>
> I'd like some heuristic for determining when <GL/glext.h> can be expected to
> exist. My
> concern comes from trying to distribute a large body of OpenGL code (the
> GLUT
> source code distribution) that needs to compile without errors on a large
> collection
> of operating systems and OpenGL installation types.
Most source code distributions for Linux applications use 'autoconf/automake'
to create a 'configure' script which the user runs at install time. That is
a sufficiently standard process that I think it's safe to assume
that everyone who needs it can make use of it - or something equivalent.
You need some mechanism like that because header file and libraries are
often installed in different places under different Linux distros - despite
the best efforts of standardization processes like the OpenGL ABI.
With autoconf, it's very easy to test for the existance of a specific
header file (so long as there are only a couple of places where it's
likely to be installed) - and provide a '-D' commandline directive
to allow your code to say:
#ifdef GLEXT_H_EXISTS
#include <GL/glext.h>
#endif
...with the GLEXT_H_EXISTS token being created by autoconf rather than
having to be defined in GL/gl.h
> My concern is that C gives an error if you try to include a file that does
> not exist.
> Lots of OpenGL implementations, particularly old installations, will not
> have <GL/glext.h>.
Indeed - but it's also possible that someone might want to download
GL/glext.h to use it with an older GL/gl.h that doesn't know about
your GL_HAS_GLEXT...well actually I'm not sure if that's 100%
reasonable.
> Can we amend Section 4 with something like:
>
> ----------
> 4.8. The <GL/gl.h> header must include the preprocessor symbol GL_HAS_GLEXT
> defined to "1" indicating that a <GL/glext.h> can be expected to exist. The
> intent of the
> GL_HAS_GLEXT preprocessor symbol is to avoid compile errors on old OpenGL
> header installations where <GL/glext.h> may not exist. This makes it
> possible
> to determine when <GL/glext.h> exists for inclusion, enabling apps to do
> something like:
>
> #include <GL/gl.h>
> #ifdef GL_HAS_GLEXT
> #include <GL/glext.h>
> #endif
> ----------
(Since it's an extension, shouldn't that be GL_HAS_GLEXT_EXT :-)
I'm not opposed to that amendment - but I don't think it's strictly
necessary either.
Steve Baker (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: [EMAIL PROTECTED] http://www.hti.com
Home: [EMAIL PROTECTED] http://web2.airmail.net/sjbaker1