/*! * @file resource_texture.h * @brief Contains the ResourceTexture class, that handles the Resource-specific loading part of the Texture. * */ #ifndef _RESOURCE_TEXTURE_H #define _RESOURCE_TEXTURE_H #include "util/loading/resource.h" #include "texture.h" class ResourceTexture : public Texture, public Resources::Resource { public: ResourceTexture(const std::string& imageName, GLenum target = GL_TEXTURE_2D, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); static ResourceTexture createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); private: class TextureResourcePointer : public Resources::StorePointer { public: TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data); inline const TextureData::Pointer& ptr() const { return pointer; } virtual bool last() const { return pointer.count() == 1; } private: TextureData::Pointer pointer; }; private: static Resources::tType type; }; #endif /* _RESOURCE_TEXTURE_H */