MCPcopy Create free account
hub / github.com/SFML/SFML / tryLoadPixelate

Function tryLoadPixelate

examples/shader/Shader.cpp:279–290  ·  view source on GitHub ↗

/////////////////////////////////////////////////////// Effect loading factory functions ///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

277// Effect loading factory functions
278////////////////////////////////////////////////////////////
279std::optional<Pixelate> tryLoadPixelate()
280{
281 sf::Texture texture;
282 if (!texture.loadFromFile("resources/background.jpg"))
283 return std::nullopt;
284
285 sf::Shader shader;
286 if (!shader.loadFromFile("resources/pixelate.frag", sf::Shader::Type::Fragment))
287 return std::nullopt;
288
289 return std::make_optional<Pixelate>(std::move(texture), std::move(shader));
290}
291
292std::optional<WaveBlur> tryLoadWaveBlur(const sf::Font& font)
293{

Callers 1

mainFunction · 0.85

Calls 1

loadFromFileMethod · 0.45

Tested by

no test coverage detected