| 42 | } |
| 43 | |
| 44 | bool Texture::create(unsigned width, unsigned height) |
| 45 | { |
| 46 | if (std::holds_alternative<sf::Texture>(m_texture)) |
| 47 | { |
| 48 | return std::get<sf::Texture>(m_texture).create(width, height); |
| 49 | } |
| 50 | if (std::holds_alternative<std::shared_ptr<sf::Texture>>(m_texture)) |
| 51 | { |
| 52 | return std::get<std::shared_ptr<sf::Texture>>(m_texture)->create( |
| 53 | width, height); |
| 54 | } |
| 55 | if (std::holds_alternative<const sf::Texture*>(m_texture)) |
| 56 | { |
| 57 | throw Exceptions::ReadOnlyTexture("create", EXC_INFO); |
| 58 | } |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | bool Texture::loadFromFile(const std::string& filename) |
| 63 | { |
no test coverage detected