Skip to content

Commit 9684500

Browse files
committed
Update for new SFML API changes
1 parent 8d3f6df commit 9684500

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Mandelbrot.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ int main()
5252
constexpr auto initial_iteration_limit = 250;
5353
constexpr auto max_extent = 4 * initial_extent;
5454

55-
auto image = sf::Image();
56-
image.create({ length, length });
55+
auto image = sf::Image({ length, length });
5756

5857
auto origin = initial_origin;
5958
auto extent = initial_extent;
@@ -62,9 +61,7 @@ int main()
6261
auto clock = sf::Clock();
6362
auto recalculate = true;
6463
auto texture = sf::Texture();
65-
auto font = sf::Font();
66-
if (!font.loadFromFile("data/font.ttf"))
67-
throw std::runtime_error("Failed to load font");
64+
const auto font = sf::Font::loadFromFile("data/font.ttf").value();
6865

6966
auto text = sf::Text(font, "", 24);
7067
text.setFillColor(sf::Color::White);

0 commit comments

Comments
 (0)