1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGBASEINITFUNCTIONS_H_
40 #define _OSGBASEINITFUNCTIONS_H_
45 #include "OSGBaseTypes.h"
50 #include <boost/function.hpp>
54 /*---------------------------------------------------------------------*/
57 /*! \ingroup GrpBaseBaseInitExit
68 extern OSG_BASE_DLLMAPPING SystemState GlobalSystemState
;
75 // * Factories internal call
78 typedef boost::function
<bool (void)> InitFuncF
;
83 // * Factories internal call
88 typedef boost::function
<bool (void)> ExitFuncF
;
90 /*! \ingroup GrpBaseBaseInitExit
92 \ingroup GrpLibOSGBase
96 struct OSG_BASE_DLLMAPPING InitFuncWrapper
98 /*---------------------------------------------------------------------*/
99 /*! \name Constructors */
102 InitFuncWrapper(const InitFuncF func
);
107 /*! \ingroup GrpBaseBaseInitExit
109 \ingroup GrpLibOSGBase
113 struct OSG_BASE_DLLMAPPING StaticInitFuncWrapper
115 /*---------------------------------------------------------------------*/
116 /*! \name Constructors */
119 StaticInitFuncWrapper(const InitFuncF func
);
126 void addPreMPInitFunction (OSG::InitFuncF initFunc
);
129 void addPreFactoryInitFunction (OSG::InitFuncF initFunc
);
132 void addPostFactoryInitFunction(OSG::InitFuncF initFunc
);
136 void addPreFactoryExitFunction (OSG::ExitFuncF exitFunc
);
139 void addPostFactoryExitFunction(OSG::ExitFuncF exitFunc
);
142 void addPreMPExitFunction (OSG::ExitFuncF exitFunc
);
145 void addPostMPExitFunction (OSG::ExitFuncF exitFunc
);
147 /*---------------------------------------------------------------------*/
148 /*! \name init / exit */
152 void preloadSharedObject(const OSG::TChar
*szName
);
155 void addLibraryVersion (const std::string
&szName
,
156 const std::string
&szVersion
,
157 const std::string
&szRevision
);
160 UInt32
getNumLibraries ( void );
163 std::string
getLibraryName ( UInt32 Index
);
166 std::string
getLibraryVersion (const std::string
&szName
);
169 std::string
getLibraryRevision (const std::string
&szName
);
172 # define OSG_INIT_DEBUG true
174 # define OSG_INIT_DEBUG false
178 # define OSG_INIT_DLL true
180 # define OSG_INIT_DLL false
183 # define OSG_INIT_MT true
185 # define OSG_INIT_MT false
188 # define OSG_INIT_DLL true
189 # define OSG_INIT_MT true
192 // osgInit needs to be inline (at least on windows),
193 // see OSGBaseInitFunctions.inl for an explanation.
196 bool osgInit (OSG::Int32 argc
,
198 OSG::UInt16 major
= OSG_MAJOR_VERSION
,
199 OSG::UInt16 minor
= OSG_MINOR_VERSION
,
200 OSG::UInt16 release
= OSG_RELEASE_VERSION
,
201 bool debug
= OSG_INIT_DEBUG
,
202 bool dll
= OSG_INIT_DLL
,
203 bool mt
= OSG_INIT_MT
);
211 bool osgDoInit(OSG::Int32 argc
,
213 OSG::UInt16 major
= OSG_MAJOR_VERSION
,
214 OSG::UInt16 minor
= OSG_MINOR_VERSION
,
215 OSG::UInt16 release
= OSG_RELEASE_VERSION
,
216 bool debug
= OSG_INIT_DEBUG
,
217 bool dll
= OSG_INIT_DLL
,
218 bool mt
= OSG_INIT_MT
);
221 void osgExitWrapper(void);
225 #include "OSGBaseInitFunctions.inl"
227 #endif /* OSGBASEINITFUNCTIONS_H */