2020-06-02 11:46:18 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "MinimalEngine.h"
|
|
|
|
|
#include "Containers/List.h"
|
2020-08-11 22:38:19 +02:00
|
|
|
#include <filesystem>
|
2020-06-02 11:46:18 +02:00
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
2021-04-01 16:40:14 +02:00
|
|
|
DECLARE_REF(TextureAsset)
|
|
|
|
|
DECLARE_NAME_REF(Gfx, Graphics)
|
|
|
|
|
DECLARE_NAME_REF(Gfx, Texture2D)
|
2023-02-01 22:13:04 +01:00
|
|
|
enum class TextureImportType
|
|
|
|
|
{
|
|
|
|
|
TEXTURE_2D,
|
|
|
|
|
TEXTURE_CUBEMAP,
|
|
|
|
|
};
|
|
|
|
|
struct TextureImportArgs
|
|
|
|
|
{
|
|
|
|
|
std::filesystem::path filePath;
|
|
|
|
|
std::string importPath;
|
|
|
|
|
TextureImportType type = TextureImportType::TEXTURE_2D;
|
|
|
|
|
};
|
2020-06-02 11:46:18 +02:00
|
|
|
class TextureLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TextureLoader(Gfx::PGraphics graphic);
|
|
|
|
|
~TextureLoader();
|
2023-02-01 22:13:04 +01:00
|
|
|
void importAsset(TextureImportArgs args);
|
2020-10-03 11:00:10 +02:00
|
|
|
PTextureAsset getPlaceholderTexture();
|
2020-06-02 11:46:18 +02:00
|
|
|
private:
|
2023-02-01 22:13:04 +01:00
|
|
|
void import(TextureImportArgs args, PTextureAsset asset);
|
2020-06-02 11:46:18 +02:00
|
|
|
Gfx::PGraphics graphics;
|
2020-10-03 11:00:10 +02:00
|
|
|
PTextureAsset placeholderAsset;
|
2020-06-02 11:46:18 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(TextureLoader)
|
2020-06-02 11:46:18 +02:00
|
|
|
} // namespace Seele
|