Starting implementation of UI framework

This commit is contained in:
Dynamitos
2021-01-19 15:30:00 +01:00
parent 65caae9e21
commit fb3c66cc4c
57 changed files with 381 additions and 186 deletions
+3 -2
View File
@@ -28,7 +28,7 @@ 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);
AssetRegistry::get().textures[filePath.string()] = asset;
AssetRegistry::get().textures[asset->getFileName()] = asset;
//futures.add(std::async(std::launch::async, [this, filePath, asset] () mutable {
Gfx::PTexture2D texture = import(filePath);
asset->setTexture(texture);
@@ -45,8 +45,9 @@ Gfx::PTexture2D TextureLoader::import(const std::filesystem::path& path)
{
int x, y, n;
unsigned char* data = stbi_load(path.string().c_str(), &x, &y, &n, 4);
TextureCreateInfo createInfo;
createInfo.format = Gfx::SE_FORMAT_R8G8B8A8_UINT;
createInfo.format = Gfx::SE_FORMAT_R8G8B8A8_SRGB;
createInfo.resourceData.data = data;
createInfo.resourceData.size = x * y * 4 * sizeof(unsigned char);
createInfo.resourceData.owner = Gfx::QueueType::DEDICATED_TRANSFER;