OpenSceneGraph/src/osg/Version.cpp

47 lines
1.3 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>
#include <stdio.h>
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)
{
2007-06-15 20:41:46 +08:00
if (OSG_VERSION_REVISION==0)
{
2007-06-15 20:41:46 +08:00
sprintf(osg_version,"%d.%d.%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE);
}
else
{
2007-06-15 20:41:46 +08:00
sprintf(osg_version,"%d.%d.%d-%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE,OSG_VERSION_REVISION);
}
2007-06-15 20:41:46 +08:00
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
}
}