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

Revision 731, 1.7 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         
37          Ogre::ResourceGroupManager *mResourceGroupManager;
38         
39          Ogre::DefaultHardwareBufferManager *mDefaultHardwareBufferManager;
40         
41          Ogre::MeshSerializer *mMeshSerializer;
42         
43          Ogre::MaterialSerializer *mMaterialSerializer;
44
45          Ogre::XMLMeshSerializer *mXMLMeshSerializer;
46         
47          Ogre::MaterialManager *mMaterialManager;
48         
49          Ogre::LogManager *mLogManager;
50         
51          Ogre::MeshManager *mMeshManager;
52         
53          FileSystemArchiveFactory *mFileSystemArchiveFactory;
54
55          Ogre::Math *mMath;
56
57  public:
58
59        static OgreBase& getSingleton(void);
60   
61        static OgreBase* getSingletonPtr(void);
62
63    OgreBase();
64
65    ~OgreBase();
66
67        Ogre::XMLMeshSerializer* getXMLMeshSerializer();
68       
69        Ogre::MaterialSerializer* getMaterialSerializer();
70
71        Ogre::MeshSerializer* getMeshSerializer();
72
73        void initialize();
74
75        void shutdown();
76};
77
78}
79#endif
Note: See TracBrowser for help on using the repository browser.