2015-03-26 17:02:51 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_RESOURCE_RESOURCESYSTEM_H
|
|
|
|
#define OPENMW_COMPONENTS_RESOURCE_RESOURCESYSTEM_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
|
|
|
|
class SceneManager;
|
2016-02-05 22:03:53 +00:00
|
|
|
class ImageManager;
|
2015-12-01 22:04:02 +00:00
|
|
|
class NifFileManager;
|
2015-12-12 17:52:06 +00:00
|
|
|
class KeyframeManager;
|
2015-03-26 17:02:51 +00:00
|
|
|
|
2015-12-01 22:04:02 +00:00
|
|
|
/// @brief Wrapper class that constructs and provides access to the most commonly used resource subsystems.
|
2015-03-28 01:20:20 +00:00
|
|
|
/// @par Resource subsystems can be used with multiple OpenGL contexts, just like the OSG equivalents, but
|
|
|
|
/// are built around the use of a single virtual file system.
|
2015-03-26 17:02:51 +00:00
|
|
|
class ResourceSystem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ResourceSystem(const VFS::Manager* vfs);
|
2015-05-08 15:52:35 +00:00
|
|
|
~ResourceSystem();
|
2015-03-26 17:02:51 +00:00
|
|
|
|
|
|
|
SceneManager* getSceneManager();
|
2016-02-05 22:03:53 +00:00
|
|
|
ImageManager* getTextureManager();
|
2015-12-01 22:04:02 +00:00
|
|
|
NifFileManager* getNifFileManager();
|
2015-12-12 17:52:06 +00:00
|
|
|
KeyframeManager* getKeyframeManager();
|
2015-12-01 22:04:02 +00:00
|
|
|
|
|
|
|
/// Indicates to each resource manager to clear the cache, i.e. to drop cached objects that are no longer referenced.
|
|
|
|
void clearCache();
|
2015-03-26 17:02:51 +00:00
|
|
|
|
|
|
|
const VFS::Manager* getVFS() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::auto_ptr<SceneManager> mSceneManager;
|
2016-02-05 22:03:53 +00:00
|
|
|
std::auto_ptr<ImageManager> mTextureManager;
|
2015-12-01 22:04:02 +00:00
|
|
|
std::auto_ptr<NifFileManager> mNifFileManager;
|
2015-12-12 17:52:06 +00:00
|
|
|
std::auto_ptr<KeyframeManager> mKeyframeManager;
|
2015-03-26 17:02:51 +00:00
|
|
|
|
|
|
|
const VFS::Manager* mVFS;
|
2015-05-08 15:52:35 +00:00
|
|
|
|
|
|
|
ResourceSystem(const ResourceSystem&);
|
|
|
|
void operator = (const ResourceSystem&);
|
2015-03-26 17:02:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|