| 157 | #endif |
| 158 | |
| 159 | bool Texture::LoadFile(const StringView& path, bool generateMips) |
| 160 | { |
| 161 | if (!IsVirtual()) |
| 162 | { |
| 163 | LOG(Error, "Loading image from file is supported only for virtual textures."); |
| 164 | return true; |
| 165 | } |
| 166 | |
| 167 | TextureData textureData; |
| 168 | if (TextureTool::ImportTexture(path, textureData)) |
| 169 | { |
| 170 | return true; |
| 171 | } |
| 172 | |
| 173 | auto initData = New<InitData>(); |
| 174 | initData->FromTextureData(textureData, generateMips); |
| 175 | |
| 176 | return Init(initData); |
| 177 | } |
| 178 | |
| 179 | Texture* Texture::FromFile(const StringView& path, bool generateMips) |
| 180 | { |
no test coverage detected