Namespace problem in nxOgre headers?

raicuandi

25-11-2006 10:26:58

In one of the headers of or related to nxOgre there is an
using namespace Ogre;
Which is VERY BAD, because every cpp that will include that unknown to me header will inherit that "using namespace Ogre;" :( although I don't put it myself in my cpp!

That is pretty bad, because I will get naming conflicts (ie: my engine's FrameEvent and Ogre's FrameEvent) and the whole point of namespaces disapear :cry:

I didn't had this problem before upgrading to nxOgre (I just did "include <nxOgre.h>"), so please try to solve this till next release! It could also be from other stuff nxogre uses, like tutorialApplication.h

Also, I am in a dire need of a good wrapper between ogre3d and physx, so if you need any help, just email me at raicuandi at gmail dot com, but only if you have a specific task for me please.

betajaen

25-11-2006 10:33:43

You do realise that NxOgre is open source, and I'm more than happy for you to remove the line "using namespace Ogre;" in "nxOgre_debugOverlay.cpp".

Dismissing NxOgre on that is just plain stupid.

raicuandi

25-11-2006 10:34:35

Yes, I was right.
The file "nxOgre_debugoverlay.h" contains on line 27:
using namespace Ogre;

For the next version, please remove it, or better yet, move it on line 32, to be inside of "class _nxOgreExport debugOverlay {" :wink:
That way you don't have to change anything else in the code, and the namespace polution problem is solved! :)

raicuandi

25-11-2006 10:36:49

You do realise that NxOgre is open source, and I'm more than happy for you to remove the line "using namespace Ogre;" in "nxOgre_debugOverlay.cpp".

Dismissing NxOgre on that is just plain stupid.


No, in the header. And of course I'm not dismissing nxOgre :) I was just saying that I have a good reason to help (since the version 0.4.2 clearly states me that nxOgre is not done ;) ).
The namespace polution is only about headers, .cpp are out of this problem :)

raicuandi

25-11-2006 10:45:30

Ah, shit, it doesn't work moving it. Well then, remove the "using" line,
and put a "Ogre::" in front of the corresponding ogre stuff on line ~74 (Vector2 and Vector3).

Sory for the confusion :)

betajaen

25-11-2006 12:00:14

I'm glad.

And for the record the NxOgre core is done. The next-gen effects; cloth, particles, fluids, etc are implemented by not perfected.

Also don't triple post in the future there is an edit button for that purpose.