Skip to content

Commit

Permalink
Update to new SFML 3 API
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Jun 23, 2024
1 parent 5a14917 commit f126954
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Raytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ int main()
sf::VideoMode({ image_width, image_height }), "Raytracer", sf::Style::Default ^ sf::Style::Resize);
window.setFramerateLimit(15);
while (window.isOpen()) {
while (const auto event = window.pollEvent()) {
if (event.is<sf::Event::Closed>()) {
while (const std::optional event = window.pollEvent()) {
if (event->is<sf::Event::Closed>()) {
window.close();
} else if (const auto* key_pressed = event.getIf<sf::Event::KeyPressed>()) {
} else if (const auto* key_pressed = event->getIf<sf::Event::KeyPressed>()) {
if (key_pressed->scancode == sf::Keyboard::Scan::Escape)
window.close();
}
Expand Down

0 comments on commit f126954

Please sign in to comment.