const& String Root::getVersion()

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

const& String Root::getVersion()

Post by steven »

Hey

Could it be possible to add the method Root::getVersion() returning the ogre version?

Code: Select all

static const String& getVersion() { return mVersion; };
Even better if it could tell the build version : debug or release.

This would permit me to make diagnostic tests on tester machines ensuring that the correct version of ogre is installed.

Thanks
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

There are macros for this. OGRE_DEBUG_MODE is 1 if compiled in debug mode, 0 else, see OgrePlatform.h for details. OGRE_VERSION the combined version number (major, minor, patchlevel) See OgrePrerequisites.h for details.

Version string can be built this way:

Code: Select all

std::stringstream ss;
ss << "Ogre3D "
    << OGRE_VERSION_MAJOR << "."
    << OGRE_VERSION_MINOR << "."
    << OGRE_VERSION_PATCH 
    << " (" << OGRE_VERSION_NAME ")";
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post by steven »

yes - I know

But I thought it was more elegant to have a get method.
And it doesn't tell me if its debug or release.

Also I need to import OgePrerequisites.h which I would prefer not.
As it has lots of #pragma that I would like to avoid in my code.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

You've got OgrePrerequisites.h whether you know it or not. It's included in every single Ogre header file, the clue is in the name ;)
Post Reply