Skip to content

Commit

Permalink
Update to new event syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAUT committed Jul 21, 2024
1 parent e5f3eb3 commit e77d163
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/minimal/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ int main() {
sf::Clock deltaClock;
while (window.isOpen()) {
while (const auto event = window.pollEvent()) {
ImGui::SFML::ProcessEvent(window, event);
ImGui::SFML::ProcessEvent(window, *event);

if (event.is<sf::Event::Closed>()) {
if (event->is<sf::Event::Closed>()) {
window.close();
}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/multiple_windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ int main() {
while (window.isOpen()) {
// Main window event processing
while (const auto event = window.pollEvent()) {
ImGui::SFML::ProcessEvent(window, event);
if (event.is<sf::Event::Closed>()) {
ImGui::SFML::ProcessEvent(window, *event);
if (event->is<sf::Event::Closed>()) {
if (childWindow.isOpen()) {
childWindow.close();
}
Expand All @@ -31,8 +31,8 @@ int main() {
// Child window event processing
if (childWindow.isOpen()) {
while (const auto event = childWindow.pollEvent()) {
ImGui::SFML::ProcessEvent(childWindow, event);
if (event.is<sf::Event::Closed>()) {
ImGui::SFML::ProcessEvent(childWindow, *event);
if (event->is<sf::Event::Closed>()) {
childWindow.close();
ImGui::SFML::Shutdown(childWindow);
}
Expand Down

0 comments on commit e77d163

Please sign in to comment.