[721] | 1 | #ifndef _OBAOGREBASE_H |
---|
| 2 | #define _OBAOGREBASE_H |
---|
| 3 | |
---|
| 4 | #include <OBAPrerequisites.h> |
---|
| 5 | #include <OBASingleton.h> |
---|
| 6 | |
---|
| 7 | namespace OBA { |
---|
| 8 | |
---|
| 9 | /** Specialisation of ArchiveFactory for FileSystem files. */
|
---|
| 10 | class _OBAExport FileSystemArchiveFactory : public Ogre::ArchiveFactory
|
---|
| 11 | {
|
---|
| 12 | public:
|
---|
| 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 | |
---|
| 32 | class _OBAExport OgreBase: public CSingleton<OgreBase> |
---|
| 33 | { |
---|
| 34 | protected: |
---|
| 35 | Ogre::ArchiveManager *mArchiveManager; |
---|
[731] | 36 | |
---|
[721] | 37 | Ogre::ResourceGroupManager *mResourceGroupManager; |
---|
[731] | 38 | |
---|
[721] | 39 | Ogre::DefaultHardwareBufferManager *mDefaultHardwareBufferManager; |
---|
[731] | 40 | |
---|
[721] | 41 | Ogre::MeshSerializer *mMeshSerializer; |
---|
[731] | 42 | |
---|
| 43 | Ogre::MaterialSerializer *mMaterialSerializer; |
---|
| 44 | |
---|
[721] | 45 | Ogre::XMLMeshSerializer *mXMLMeshSerializer; |
---|
[731] | 46 | |
---|
[721] | 47 | Ogre::MaterialManager *mMaterialManager; |
---|
[731] | 48 |
|
---|
[721] | 49 | Ogre::LogManager *mLogManager;
|
---|
[731] | 50 |
|
---|
[721] | 51 | Ogre::MeshManager *mMeshManager;
|
---|
[731] | 52 |
|
---|
[721] | 53 | FileSystemArchiveFactory *mFileSystemArchiveFactory;
|
---|
[731] | 54 |
|
---|
[721] | 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 | |
---|
[731] | 69 | Ogre::MaterialSerializer* getMaterialSerializer(); |
---|
| 70 | |
---|
[721] | 71 | Ogre::MeshSerializer* getMeshSerializer(); |
---|
| 72 | |
---|
| 73 | void initialize(); |
---|
| 74 | |
---|
| 75 | void shutdown(); |
---|
| 76 | }; |
---|
| 77 | |
---|
| 78 | } |
---|
| 79 | #endif |
---|