! read png texture from disk */
| 81 | |
| 82 | /*! read png texture from disk */ |
| 83 | std::shared_ptr<Texture> Texture::load(const FileName& fileName) |
| 84 | { |
| 85 | if (texture_cache.find(fileName.str()) != texture_cache.end()) |
| 86 | return texture_cache[fileName.str()]; |
| 87 | |
| 88 | std::shared_ptr<Texture> tex(new Texture(loadImage(fileName),fileName)); |
| 89 | return texture_cache[fileName.str()] = tex; |
| 90 | } |
| 91 | } |