#ifndef OPENMW_COMPONENTS_RESOURCE_TEXTUREMANAGER_H #define OPENMW_COMPONENTS_RESOURCE_TEXTUREMANAGER_H #include #include #include #include #include namespace osgViewer { class Viewer; } namespace VFS { class Manager; } namespace osgDB { class Options; } namespace Resource { /// @brief Handles loading/caching of Images. class ImageManager { public: ImageManager(const VFS::Manager* vfs); ~ImageManager(); /// Create or retrieve an Image /// Returns the dummy image if the given image is not found. osg::ref_ptr getImage(const std::string& filename); const VFS::Manager* getVFS() { return mVFS; } osg::Texture2D* getWarningTexture(); private: const VFS::Manager* mVFS; // TODO: use ObjectCache std::map > mImages; osg::ref_ptr mWarningTexture; osg::ref_ptr mWarningImage; osg::ref_ptr mOptions; ImageManager(const ImageManager&); void operator = (const ImageManager&); }; } #endif