diff --git a/ResourcePath.cpp b/ResourcePath.cpp index fb1f1f0..4f4daf2 100644 --- a/ResourcePath.cpp +++ b/ResourcePath.cpp @@ -1,15 +1,12 @@ //------------------------------------------------------- -// -// Resource Path for using SFML in Eclipse CDT. -// // Uses CoreFoundation on Mac OS to return the proper // resource path for bundled applications // // Based on resourcePath.mm provided with the Xcode // templates for SFML. This version contains no // Objective-C code, allowing it to be compiled in -// Eclipse so the file can be used regardless of platform -// or development environment. +// non-Xcode IDEs so the file can be used regardless of +// platform or development environment. // //------------------------------------------------------- diff --git a/main.cpp b/main.cpp index b1ad415..ddecf16 100644 --- a/main.cpp +++ b/main.cpp @@ -73,10 +73,12 @@ int main() accumulator -= updateInterval; ++ticks; sf::Event event; - win.pollEvent(event); - if (event.type == sf::Event::Closed) + while (win.pollEvent(event)) { - win.close(); + if (event.type == sf::Event::Closed) + { + win.close(); + } } // Update loop @@ -103,7 +105,9 @@ int main() float povY = hasPovY ? sf::Joystick::getAxisPosition(i, sf::Joystick::PovY) : 0; std::ostringstream stream; - stream << sf::Joystick::getName(i) << "\n"; + // Uncomment this if you are using an SFML version that supports + // Joystick names. See: https://github.com/NoobsArePeople2/SFML + // stream << sf::Joystick::getName(i) << "\n"; stream << "Axis X: " << x << "\nAxis Y: " << y << "\nAxis Z: " << z; gui.at(i).at(0).setString(stream.str()); stream.str("");