File tree 3 files changed +5
-9
lines changed
3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,7 @@ Using ImGui-SFML in your code
73
73
- Poll and process events:
74
74
75
75
```cpp
76
- sf::Event event;
77
- while (window.pollEvent(event)) {
76
+ while (const auto event = window.pollEvent()) {
78
77
ImGui::SFML::ProcessEvent(window, event);
79
78
...
80
79
}
@@ -114,8 +113,7 @@ int main() {
114
113
115
114
sf::Clock deltaClock;
116
115
while (window.isOpen()) {
117
- sf::Event event;
118
- while (window.pollEvent(event)) {
116
+ while (const auto event = window.pollEvent()) {
119
117
ImGui::SFML::ProcessEvent (window, event);
120
118
121
119
if (event.type == sf::Event::Closed) {
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ int main() {
14
14
15
15
sf::Clock deltaClock;
16
16
while (window.isOpen ()) {
17
- sf::Event event{};
18
- while (window.pollEvent (event)) {
17
+ while (const auto event = window.pollEvent ()) {
19
18
ImGui::SFML::ProcessEvent (window, event);
20
19
21
20
if (event.is <sf::Event::Closed>()) {
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ int main() {
16
16
sf::Clock deltaClock;
17
17
while (window.isOpen ()) {
18
18
// Main window event processing
19
- sf::Event event{};
20
- while (window.pollEvent (event)) {
19
+ while (const auto event = window.pollEvent ()) {
21
20
ImGui::SFML::ProcessEvent (window, event);
22
21
if (event.is <sf::Event::Closed>()) {
23
22
if (childWindow.isOpen ()) {
@@ -31,7 +30,7 @@ int main() {
31
30
32
31
// Child window event processing
33
32
if (childWindow.isOpen ()) {
34
- while (childWindow.pollEvent (event )) {
33
+ while (const auto event = childWindow.pollEvent ()) {
35
34
ImGui::SFML::ProcessEvent (childWindow, event);
36
35
if (event.is <sf::Event::Closed>()) {
37
36
childWindow.close ();
You can’t perform that action at this time.
0 commit comments