In your message of 24 March 2000 you write:
> 1) include extension defs or glext.h in gl.h everywhere (except windows)
> Pros:
> - nobody ever has to decide whether or not to include it
> - new code is portable to other OS's
> Cons:
> - legacy code or makefiles will require minor mods, a short term problem
>
This is really not an option at all. It will break pretty much
everything. Let's assume your libGL.so has not implemented
EXT_paletted_texture. In this case, glColorTableEXT() is not available
at linktime. Asume an application now uses code like this (which is
common practice):
#ifdef GL_EXT_paletted_texture
glColorTableEXT(...);
#endif
It will simply break at linktime, or depending upon ld.so relevant
flags at runtime. Why ? Because glext.h MUST define
EXT_paletted_texture to state that the relevant defines are there. So
what this option does it to force every application to use
glXGetProcAddressARB() for every extension function since it cannot
tell whether the direct callable function will be present. This will
lead to something like this:
#ifdef GL_EXT_paletted_texture
#ifdef GL_ARB_get_proc_address
(*glXGetProcAddressARB("glColorTableEXT")(...);
#else
glColorTableEXT(...);
#endif
#endif
This means that portablity to other OSes is only at the expense of a
significant rewrite of code. In fact, by default all current
applications that use extensions will break. Unless of course libGL.so
includes every possible extension function entry point at linktime.
> 2) add a symbol, any symbol, which promises that glext.h exists
> Pros:
> - apps that want extensions on Linux can reliably include this header
> - new code is portable to other OS's
> Cons:
> - apps that want extensions on Linux must include this header
> - the problem of whether or not to include glext.h on other platforms
> remains unsolved
Yes and no. Back again to the fact that glext.h makes only sence if
you either are running on Windows (as you then have
wglGetProcAddress()), or if GLX_ARB_get_proc_address is defined.
So simply assuming that "#if defined(WINDOWS) || defined(GLX_ARB_get_proc_address)"
will tell the availability of glext.h is not working.
So either there needs to be a symbol somewhere stating that glext.h is
present (has nothing to do with linux or windows or any operating
system), or it's up to the makefile/application to deal with that.
- Thomas
--
Thomas Roell /\ An imperfect plan executed violently
Xi Graphics / \/\ _ is far superior to a perfect plan.
[EMAIL PROTECTED] / / \ \
/ Oelch! \ \ George Patton