osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarth/Version.cpp

Go to the documentation of this file.
00001 /* -*-c++-*- */
00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
00003  * Copyright 2008-2010 Pelican Mapping
00004  * http://osgearth.org
00005  *
00006  * osgEarth is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>
00018  */
00019 
00020 #include <osgEarth/Common>
00021 #include <osgEarth/Version>
00022 #include <string>
00023 #include <stdio.h>
00024 
00025 extern "C" {
00026 
00027 const char* osgEarthGetVersion()
00028 {
00029     static char osgearth_version[256];
00030     static int osgearth_version_init = 1;
00031     if (osgearth_version_init)
00032     {
00033         if (OSGEARTH_VERSION_REVISION==0)
00034         {
00035             sprintf(osgearth_version,"%d.%d.%d",OSGEARTH_MAJOR_VERSION,OSGEARTH_MINOR_VERSION,OSGEARTH_PATCH_VERSION);
00036         }
00037         else
00038         {
00039             sprintf(osgearth_version,"%d.%d.%d-%d",OSGEARTH_MAJOR_VERSION,OSGEARTH_MINOR_VERSION,OSGEARTH_PATCH_VERSION,OSGEARTH_VERSION_REVISION);
00040         }
00041 
00042         osgearth_version_init = 0;
00043     }
00044     
00045     return osgearth_version;
00046 }
00047 
00048 const char* osgEarthGetSOVersion()
00049 {
00050     static char osgearth_soversion[32];
00051     static int osgearth_soversion_init = 1;
00052     if (osgearth_soversion_init)
00053     {
00054         sprintf(osgearth_soversion,"%d",OSGEARTH_SOVERSION);
00055         osgearth_soversion_init = 0;
00056     }
00057     
00058     return osgearth_soversion;
00059 }
00060 
00061 const char* osgEarthGetLibraryName()
00062 {
00063     return "osgEarth Library";
00064 }
00065 
00066 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines