Temp texture for create ktxtexture.
Temp texture for create ktxtexture.
29 {
31
32 std::filesystem::path path(fileName);
33 if (path.is_absolute())
34 {
35 if (path.extension().string() == "ktx")
36 {
37 LoadBin(fileName,
"", outTexture);
38 }
39 else
40 {
41 LoadSrc(fileName,
"", outTexture,
false);
42 }
43
44 return;
45 }
46
48 fileName,
49 [&](const std::string& it) {
50 LoadBin(fileName, it, outTexture);
51 },
52 [&](const std::string& it) {
53
57 std::unique_ptr<Texture2D> texture = std::make_unique<Texture2D>();
58 LoadSrc(fileName, it, texture.get());
59 LoadBin(fileName, it, outTexture);
60 }
61 );
62 }
#define SPICES_PROFILE_ZONE
static bool LoadSrc(const std::string &fileName, const std::string &it, Texture2D *outTexture, bool isCreateCompressTexture=true)
Function of load a src file.
static bool SearchFile(const std::string &fileName, std::function< void(const std::string &)> binF, std::function< void(const std::string &)> srcF)
Search texture file and load.
static bool LoadBin(const std::string &fileName, const std::string &it, Texture2D *outTexture)
Function of load a ktx file.