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

33 lines
1.0 KiB
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
2020-10-03 11:00:10 +02:00
struct aiScene;
struct aiTexel;
2020-06-02 11:46:18 +02:00
namespace Seele
{
2020-10-03 11:00:10 +02:00
DECLARE_REF(Mesh);
DECLARE_REF(MeshAsset);
DECLARE_REF(MaterialAsset);
2020-06-02 11:46:18 +02:00
DECLARE_NAME_REF(Gfx, Graphics);
class MeshLoader
{
public:
MeshLoader(Gfx::PGraphics graphic);
~MeshLoader();
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-10-03 11:00:10 +02:00
void loadMaterials(const aiScene* scene, Array<PMaterialAsset>& globalMaterials, Gfx::PGraphics graphics);
void loadTextures(const aiScene* scene, Gfx::PGraphics graphics, const std::filesystem::path& meshPath);
void loadGlobalMeshes(const aiScene* scene, Array<PMesh>& globalMeshes, Array<PMaterialAsset> materials, Gfx::PGraphics graphics);
void convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numPixels);
2020-06-08 01:44:47 +02:00
void import(const std::filesystem::path& path);
2020-06-02 11:46:18 +02:00
List<std::future<void>> futures;
Gfx::PGraphics graphics;
};
DEFINE_REF(MeshLoader);
} // namespace Seele