source: GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/OBA/OBAOgreBase.h @ 721

Revision 721, 1.6 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef _OBAOGREBASE_H
2#define _OBAOGREBASE_H
3
4#include <OBAPrerequisites.h>
5#include <OBASingleton.h>
6
7namespace OBA {
8
9/** Specialisation of ArchiveFactory for FileSystem files. */
10class _OBAExport FileSystemArchiveFactory : public Ogre::ArchiveFactory
11{
12public:
13    virtual ~FileSystemArchiveFactory() {}
14
15        /// @copydoc FactoryObj::getType
16        const Ogre::String& getType(void) const
17    {
18                static Ogre::String name = "FileSystem";
19        return name;
20    }
21
22    /// @copydoc FactoryObj::createInstance
23        Ogre::Archive *createInstance( const Ogre::String& name )
24    {
25                return new Ogre::FileSystemArchive(name, "FileSystem");
26    }
27
28        /// @copydoc FactoryObj::destroyInstance
29        void destroyInstance( Ogre::Archive* arch) { delete arch; }
30};
31
32class _OBAExport OgreBase: public CSingleton<OgreBase>
33{
34  protected:
35          Ogre::ArchiveManager *mArchiveManager;
36          Ogre::ResourceGroupManager *mResourceGroupManager;
37          Ogre::DefaultHardwareBufferManager *mDefaultHardwareBufferManager;
38          Ogre::MeshSerializer *mMeshSerializer;
39          Ogre::XMLMeshSerializer *mXMLMeshSerializer;
40          Ogre::MaterialManager *mMaterialManager;
41          Ogre::LogManager *mLogManager;
42          Ogre::MeshManager *mMeshManager;
43          FileSystemArchiveFactory *mFileSystemArchiveFactory;
44          Ogre::Math *mMath;
45
46  public:
47
48        static OgreBase& getSingleton(void);
49   
50        static OgreBase* getSingletonPtr(void);
51
52    OgreBase();
53
54    ~OgreBase();
55
56        Ogre::XMLMeshSerializer* getXMLMeshSerializer();
57       
58        Ogre::MeshSerializer* getMeshSerializer();
59
60        Ogre::MeshManager* getMeshManager();
61
62        void initialize();
63
64        void shutdown();
65};
66
67}
68#endif
Note: See TracBrowser for help on using the repository browser.