3700 FPS here we go

This commit is contained in:
Dynamitos
2021-04-13 23:09:16 +02:00
parent d5f0fe644f
commit 312ae2af9a
36 changed files with 401 additions and 231 deletions
+4 -2
View File
@@ -28,12 +28,14 @@ void TextureLoader::importAsset(const std::filesystem::path& filePath)
PTextureAsset asset = new TextureAsset(assetFileName.replace_extension("asset").filename().generic_string());
asset->setStatus(Asset::Status::Loading);
asset->setTexture(placeholderTexture);
std::cout << "Loading texture, placeholder" << std::endl;
AssetRegistry::get().textures[asset->getFileName()] = asset;
//futures.add(std::async(std::launch::async, [this, filePath, asset] () mutable {
futures.add(std::async(std::launch::async, [this, filePath, asset] () mutable {
Gfx::PTexture2D texture = import(filePath);
asset->setTexture(texture);
asset->setStatus(Asset::Status::Ready);
//}));
std::cout << "Finished loading texture" << std::endl;
}));
}
PTextureAsset TextureLoader::getPlaceholderTexture()