Hi Benjamin,

On 5 August 2014 19:05, Benjamin Beier <[email protected]> wrote:

> some typedefs are not contained within an OSG specific namespace and
> therefore cause collisions.
>

OSG specific typedefs will all be in appropriate namespaces.

The OpenGL typedef's are currently made in the global namespace as per
OpenGL headers and should only be defined when OpenGL headers don't define
them.



> One example is 'typedef char GLchar;' in the GL2Extension header, which
> causes a collision with the same typname in the JUCE Library.
> Fortunately the JUCE Library is using correct namespaces, so i was able to
> workaround the problem by reordering the header includes.
> Nevertheless this is annoying and should be fixed.
>

Which namespace is appropriate OpenGL typedefs is not clear cut. OpenGL
itself doesn't use namspaces as it's C.  Alas not all OpenGL headers
installed on users machine contain all the definitions so we have to
provide our own as a fallback.

I haven't heard of JUICE library before so can't comment on the specifics
of this library and how it tackles these issue, but if their are issues
with integrating with the OSG it sounds like JUICE library isn't
necessarily honouring the various OpenGL #define's used to control which
typedefs are provided.


> OSGs excessive use of preprocessor constants which never respect
> namespaces can also easily lead to problems, although the probability is
> lower.
>

OSG pre-processors almost always have an OSG_ or similar prefix.

Feel free to be specific with the exceptions to this.

--

As a general note the OSG is across many platforms and alongside may other
toolkits with very few reports of namespace pollution issues so it's not
something that is a big issue, any changes required to appease minority
opinions will need to considered alongside issues of backwards
compatibility.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to