| 540 | } |
| 541 | |
| 542 | void Renderer::InitializeCommonTextures() |
| 543 | { |
| 544 | // Initialize font. |
| 545 | auto fontPath = GetAssetPath(L"Textures/Font.spritefont"); |
| 546 | if (!std::filesystem::is_regular_file(fontPath)) |
| 547 | throw std::runtime_error("Font not found; path " + TEN::Utils::ToString(fontPath) + " is missing."); |
| 548 | |
| 549 | _gameFont = std::make_unique<SpriteFont>(_device.Get(), fontPath.c_str()); |
| 550 | |
| 551 | // Initialize common textures. |
| 552 | SetTextureOrDefault(_logo, GetAssetPath(L"Textures/Logo.png")); |
| 553 | SetTextureOrDefault(_loadingBarBorder, GetAssetPath(L"Textures/LoadingBarBorder.png")); |
| 554 | SetTextureOrDefault(_loadingBarInner, GetAssetPath(L"Textures/LoadingBarInner.png")); |
| 555 | SetTextureOrDefault(_whiteTexture, GetAssetPath(L"Textures/WhiteSprite.png")); |
| 556 | |
| 557 | _context->Flush(); |
| 558 | |
| 559 | _whiteSprite.Height = _whiteTexture.Height; |
| 560 | _whiteSprite.Width = _whiteTexture.Width; |
| 561 | _whiteSprite.UV[0] = Vector2(0.0f, 0.0f); |
| 562 | _whiteSprite.UV[1] = Vector2(1.0f, 0.0f); |
| 563 | _whiteSprite.UV[2] = Vector2(1.0f, 1.0f); |
| 564 | _whiteSprite.UV[3] = Vector2(0.0f, 1.0f); |
| 565 | _whiteSprite.Texture = &_whiteTexture; |
| 566 | } |
| 567 | |
| 568 | void Renderer::Create() |
| 569 | { |
nothing calls this directly
no test coverage detected