snipplets.dev/code/SFML/appIcon.cpp

10 lines
182 B
C++

// ...
auto image = sf::Image{};
if (!image.loadFromFile("cat.png"))
{
// Error handling...
}
window.setIcon(image.getSize().x, image.getSize().y, image.getPixelsPtr());
// ...