2020-06-02 11:46:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "MinimalEngine.h"
|
|
|
|
|
#include "Containers/List.h"
|
|
|
|
|
#include <thread>
|
|
|
|
|
#include <future>
|
|
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
DECLARE_REF(TextureAsset);
|
|
|
|
|
DECLARE_NAME_REF(Gfx, Graphics);
|
|
|
|
|
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-06-08 01:44:47 +02:00
|
|
|
void import(const std::filesystem::path& path);
|
2020-06-02 11:46:18 +02:00
|
|
|
Gfx::PGraphics graphics;
|
|
|
|
|
List<std::future<void>> futures;
|
|
|
|
|
PTextureAsset placeholderTexture;
|
|
|
|
|
};
|
|
|
|
|
DEFINE_REF(TextureLoader);
|
|
|
|
|
} // namespace Seele
|