OpenSceneGraph/src/osg/Version.cpp

59 lines
1.7 KiB
C++
Raw Normal View History

2006-07-18 23:21:48 +08:00
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osg/Version>
#include <string>
extern "C" {
2001-01-11 00:32:10 +08:00
const char* osgGetVersion()
{
static char osg_version[256];
static int osg_version_init = 1;
if (osg_version_init)
{
if (OSG_VERSION_RELEASE==0)
{
if (OSG_VERSION_REVISION==0)
{
sprintf(osg_version,"%d.%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR);
}
else
{
sprintf(osg_version,"%d.%d-%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_REVISION);
}
}
else
{
if (OSG_VERSION_REVISION==0)
{
sprintf(osg_version,"%d.%d.%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE);
}
else
{
sprintf(osg_version,"%d.%d.%d-%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE,OSG_VERSION_REVISION);
}
}
osg_version_init = 0;
}
return osg_version;
2001-01-11 00:32:10 +08:00
}
2001-01-11 00:32:10 +08:00
const char* osgGetLibraryName()
{
return "OpenSceneGraph Library";
2001-01-11 00:32:10 +08:00
}
}