MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / loadFromFile

Method loadFromFile

src/Core/Graphics/Texture.cpp:62–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 bool Texture::loadFromFile(const std::string& filename)
63 {
64 if (std::holds_alternative<sf::Texture>(m_texture))
65 {
66 return std::get<sf::Texture>(m_texture).loadFromFile(filename);
67 }
68 if (std::holds_alternative<std::shared_ptr<sf::Texture>>(m_texture))
69 {
70 return std::get<std::shared_ptr<sf::Texture>>(m_texture)->loadFromFile(
71 filename);
72 }
73 if (std::holds_alternative<const sf::Texture*>(m_texture))
74 {
75 throw Exceptions::ReadOnlyTexture("loadFromFile", EXC_INFO);
76 }
77 return false;
78 }
79
80 bool Texture::loadFromFile(const std::string& filename, const Transform::Rect& rect)
81 {

Callers 2

loadTextureMethod · 0.45
loadShaderMethod · 0.45

Calls 2

ReadOnlyTextureClass · 0.85
getPositionMethod · 0.45

Tested by

no test coverage detected