1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00
OpenMW/components/resource/imagemanager.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
C++
Raw Normal View History

#ifndef OPENMW_COMPONENTS_RESOURCE_IMAGEMANAGER_H
#define OPENMW_COMPONENTS_RESOURCE_IMAGEMANAGER_H
#include <osg/Image>
#include <osg/Texture2D>
#include <osg/ref_ptr>
2024-09-15 12:19:32 +00:00
#include <components/vfs/pathutil.hpp>
#include "resourcemanager.hpp"
namespace osgDB
{
class Options;
}
namespace Resource
{
/// @brief Handles loading/caching of Images.
/// @note May be used from any thread.
class ImageManager : public ResourceManager
{
public:
explicit ImageManager(const VFS::Manager* vfs, double expiryDelay);
2016-02-05 22:03:53 +00:00
~ImageManager();
/// Create or retrieve an Image
/// Returns the dummy image if the given image is not found.
2024-09-15 12:19:32 +00:00
osg::ref_ptr<osg::Image> getImage(VFS::Path::NormalizedView path, bool disableFlip = false);
osg::Image* getWarningImage();
2015-06-19 18:55:04 +00:00
void reportStats(unsigned int frameNumber, osg::Stats* stats) const override;
private:
osg::ref_ptr<osg::Image> mWarningImage;
osg::ref_ptr<osgDB::Options> mOptions;
osg::ref_ptr<osgDB::Options> mOptionsNoFlip;
2016-02-05 22:03:53 +00:00
ImageManager(const ImageManager&);
void operator=(const ImageManager&);
};
}
#endif