| 65 | } |
| 66 | |
| 67 | void Renderer::SetTextureOrDefault(Texture2D& texture, std::wstring path) |
| 68 | { |
| 69 | texture = Texture2D(); |
| 70 | |
| 71 | if (std::filesystem::is_regular_file(path)) |
| 72 | { |
| 73 | texture = Texture2D(_device.Get(), path); |
| 74 | } |
| 75 | else if (!path.empty()) // Loading default texture without path may be intentional. |
| 76 | { |
| 77 | std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter; |
| 78 | TENLog("Texture file not found: " + converter.to_bytes(path), LogLevel::Warning); |
| 79 | } |
| 80 | } |
| 81 | } |