Files
Seele/src/Engine/Asset/TextureAsset.h
T

31 lines
700 B
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#include "Asset.h"
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_NAME_REF(Gfx, Texture)
2020-06-02 11:46:18 +02:00
class TextureAsset : public Asset
{
public:
TextureAsset();
TextureAsset(const std::string& directory, const std::string& name);
2020-06-08 01:44:47 +02:00
TextureAsset(const std::filesystem::path& fullPath);
virtual ~TextureAsset();
virtual void save() override;
virtual void load() override;
void setTexture(Gfx::PTexture _texture)
2020-06-02 11:46:18 +02:00
{
2022-01-12 14:40:26 +01:00
std::scoped_lock lck(lock);
texture = _texture;
2020-06-02 11:46:18 +02:00
}
Gfx::PTexture getTexture()
{
2022-01-12 14:40:26 +01:00
std::scoped_lock lck(lock);
2020-06-02 11:46:18 +02:00
return texture;
}
private:
Gfx::PTexture texture;
2021-01-19 15:30:00 +01:00
friend class TextureLoader;
2020-06-02 11:46:18 +02:00
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(TextureAsset)
2020-06-02 11:46:18 +02:00
} // namespace Seele