nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nel] patch to compile on GNU/Linux


From: Loic Dachary
Subject: Re: [Nel] patch to compile on GNU/Linux
Date: Mon, 11 Feb 2002 22:58:27 +0100

Lionel Berenguier writes:
 > Tank you for this patch.
 > 
 > We have decided to use our own GL extension function declaration (eg: use
 > NEL_PFNGLACTIVETEXTUREARBPROC instead of PFNGLACTIVETEXTUREARBPROC, and use
 > nglMultiTexCoord1sARB() instead of glMultiTexCoord1sARB()) to avoid
 > conflicts with differents version of gl.h  (I think GL extnesion is a mess
 > here since extensions defined in gl.h do not define function typedef but
 > still define GL_ARB_multitexture for example).

        Hi,

        I do agree that nglMultiTexCoord1sARB() instead of
glMultiTexCoord1sARB() is a good idea. From a strictly technical point
of view this is not really needed, but it's a trap in which we
would fall over and over. Conflicts with the symbols existing in 
the GL library during dynamic linking are tricky enough. However,
I tend to think that renaming all the symbols is not necessary since
we can rely on namespaces to do the job. Simply including the declaration
and definitions in the NL3D namespace gives the same result as renaming
without the trouble of actually changing all functions in the sources.

        Regarding prototypes renaming, I'm not very enthusiastic. Name
clashes are not the main concern. I prefered to add a small stanza in
the acinclude.m4 to detect the problem and define a symbol that allows
the sources to cope with it in a clean way. 

        The patch below summarizes all the changes I've done on the 
nel tree to get it to work (I mean up to the loading landscape segfault
but no more compilation or linking troubles). I think it solves issues
in a reasonable way.

        Patch summary:

        - Define AM_GL_VERIFY to cope with Mesa-3.4.2 & 4.0.1 lossage
          on multitexture declaration. Gave it a generic name so that
          we can add more tests if needs be.

          The following file should be added to the distribution:
code/nel/acconfig.h

Attachment: acconfig.h
Description: Binary data

          I also nuked NEL_GL_VERSION_1_2_IN_GL_H since it was supposed
          to cope with the problem.
        
        - Removed spurious dots in various Makefile.am SUBDIRS declarations

        - Re-generated code/nel/src/3d/Makefile.am SOURCES and added
          noinst_HEADERS for headers. I never tried to make dist but
          I suspect there are other issues like this one that would
          prevent it to succeed.

        - Fixed nel/src/3d/layered_ordering_table.cpp include and then
          figured it was not finished and therefore not used. Linking
          proved me right on this one.

        - Fixed scope issues in nel/src/3d/. Typical case is
          for(int i;;) ; 
          i = 0;
          Using "i" must not be used after the loop, its scope is limited
          to the loop and it may contain an undefined value. Not all compilers
          bark on this error.

        - nel/src/3d/static_quad_grid.h fixed an unqualified CMatrix

        - Added a 

#ifdef HAVE_CONFIG_H
#include "nelconfig.h"
#endif // HAVE_CONFIG_H

          to all .cpp files in nel/src/3d/driver/opengl. This is a must,
          otherwise we might as well drop autoheader and friends ;-)
          Although redundant it should not be added to headers. 
        
        - Reduced hairy includes. For no particular reason gl.h, glx.h
          glext.h were included in multiple places. Only the
          driver_opengl_extension.h includes were kept, other includes
          were removed.  The is not scrictly needed, I did it because
          I spent countless minutes figuring out where to look for
          actual inclusion and pulling my hairs when playing with them
          had no effect ;-)

        - Defined nelglGetProcAddress as a cpp function in order to 
          add the necessary (const GLubyte *) cast for GNU/Linux.

        - Include ARB symbols in NL3D namespace.

        Cheers,

Attachment: patch.2
Description: Binary data

-- 
Loic   Dachary         http://www.dachary.org/  address@hidden
12 bd  Magenta         http://www.senga.org/      address@hidden
75010    Paris         T: 33 1 42 45 07 97          address@hidden
        GPG Public Key: http://www.dachary.org/loic/gpg.txt

reply via email to

[Prev in Thread] Current Thread [Next in Thread]