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

26 lines
624 B
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#pragma once
#include "MinimalEngine.h"
#include "Containers/List.h"
#include <thread>
#include <future>
2020-08-11 22:38:19 +02:00
#include <filesystem>
2020-06-02 11:46:18 +02:00
namespace Seele
{
DECLARE_REF(TextureAsset);
DECLARE_NAME_REF(Gfx, Graphics);
2020-09-19 14:36:50 +02:00
DECLARE_NAME_REF(Gfx, Texture2D);
2020-06-02 11:46:18 +02:00
class TextureLoader
{
public:
TextureLoader(Gfx::PGraphics graphic);
~TextureLoader();
2020-06-08 01:44:47 +02:00
void importAsset(const std::filesystem::path& filePath);
2020-06-02 11:46:18 +02:00
private:
2020-09-19 14:36:50 +02:00
Gfx::PTexture2D import(const std::filesystem::path& path);
2020-06-02 11:46:18 +02:00
Gfx::PGraphics graphics;
List<std::future<void>> futures;
2020-09-19 14:36:50 +02:00
Gfx::PTexture2D placeholderTexture;
2020-06-02 11:46:18 +02:00
};
DEFINE_REF(TextureLoader);
} // namespace Seele