#pragma once #include "drape/texture.hpp" #include namespace dp { class StaticTexture : public Texture { using Base = Texture; public: class StaticKey : public Key { public: ResourceType GetType() const override { return ResourceType::Static; } }; static std::string const kDefaultResource; StaticTexture(ref_ptr context, std::string const & textureName, std::string const & skinPathName, dp::TextureFormat format, ref_ptr allocator); ref_ptr FindResource(Key const & key, bool & newResource) override; void Create(ref_ptr context, Params const & params) override; void Create(ref_ptr context, Params const & params, ref_ptr data) override; void Invalidate(ref_ptr context, ref_ptr allocator); bool IsLoadingCorrect() const { return m_isLoadingCorrect; } private: void Fail(ref_ptr context); bool Load(ref_ptr context, ref_ptr allocator); std::string const m_textureName; std::string const m_skinPathName; dp::TextureFormat const m_format; drape_ptr m_info; bool m_isLoadingCorrect; }; } // namespace dp