[GRASS5] NVIZ updates

Glynn Clements glynn.clements at virgin.net
Wed Nov 19 16:29:42 EST 2003


Markus Neteler wrote:

> > > Before the 5.3.0 release it will be good to get NVIZ back so that it
> > > compiles under Cygwin. There are some glX functions used that appear to be
> > > non-standard. I mentioned this before I think but here are the actual
> > > compile errors:
> > 
> > > OBJ.i686-pc-cygwin/do_zoom.o: In function `Create_OS_Ctx':
> > > /cygdrive/g/release/530/grass/src.contrib/GMSL/NVIZ2.2/src/do_zoom.c:275: undefined reference to `glXChooseFBConfig'
> > > /cygdrive/g/release/530/grass/src.contrib/GMSL/NVIZ2.2/src/do_zoom.c:287: undefined reference to `glXCreatePbuffer'
> > > /cygdrive/g/release/530/grass/src.contrib/GMSL/NVIZ2.2/src/do_zoom.c:288: undefined reference to `glXMakeContextCurrent'
> > > OBJ.i686-pc-cygwin/do_zoom.o: In function `Destroy_OS_Ctx':
> > > /cygdrive/g/release/530/grass/src.contrib/GMSL/NVIZ2.2/src/do_zoom.c:351: undefined reference to `glXDestroyPbuffer'
> > 
> > In my copy of GL/glx.h, those functions are preceded by the comment:
> > 
> > 	/* New for GLX 1.3 */
> > 
> > So, any code which uses those functions should probably be
> > conditionalised upon GLX_VERSION_1_3.
> > 
> > However, all of the lines which produce errors *are* conditionalised
> > upon GLX_PBUFFER_WIDTH. That macro is also specific to GLX 1.3.
> > 
> > This suggests that the GL headers don't match the GL libraries (GLX
> > 1.3 headers with pre-1.3 libraries). In which case, even if the code
> > was conditionalised upon the correct macro, it would probably still
> > fail for you.
> 
> Instead of checking the GL version, couldn't we check if
>  glXDestroyPbuffer()
> exists in the library with 'configure' (no idea how to do that, though)?

1. A mismatch between library and headers should really be considered
fatal. We shouldn't be saying "well, the headers say it's GLX 1.3, but
the library says that it isn't, so we'll just continue as if you have
a valid GLX 1.2 setup". If configure checks this, it should only be so
that it can abort if a mismatch is detected.

2. Even if these functions exist within the library, any given X
server may or may not provide the necessary support. NVIZ shouldn't be
using GLX 1.3 features unless glXQueryVersion() indicates that the X
server suports GLX 1.3.

3. Binary releases shouldn't have a dependency upon GLX 1.3, even if
the build system supports it. Unfortunately, glXGetProcAddressARB()
isn't universally supported, so using that instead of calling
glXCreatePbuffer() etc directly doesn't really help; that would just
exchange one dependency for another.

For the time being, the safest solution is simply not to include the
do_zoom.c changes in any released version.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list