diff options
author | Alec Thomas <alec@swapoff.org> | 2014-10-09 21:24:30 +1100 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2014-10-09 21:24:30 +1100 |
commit | 2c85b9c65fce2f45a746f7f170d635ed335bd642 (patch) | |
tree | 93aff745b87550b0bc516cff500722e62e2751f8 | |
parent | 3a3bafa72fdff90a6c439c8b3b9b43052b5cb160 (diff) |
Don't use deprecated strstream.
-rw-r--r-- | examples/example.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/example.cc b/examples/example.cc index 0caa952..28fe023 100644 --- a/examples/example.cc +++ b/examples/example.cc @@ -16,8 +16,8 @@ * c++ -O3 -std=c++11 -Wall -lsfml-system -lsfml-window -lsfml-graphics -lentityx readme.cc -o readme */ #include <unordered_set> +#include <sstream> #include <cstdlib> -#include <strstream> #include <memory> #include <string> #include <vector> @@ -248,11 +248,10 @@ public: } last_update += dt; if (last_update >= 1.0) { - std::strstream out; + std::ostringstream out; out << es.size() << " entities (" << static_cast<int>(1.0 / dt) << " fps)"; text.setString(out.str()); last_update = 0.0; - out.freeze(false); } target.draw(text); } @@ -280,7 +279,7 @@ public: ex::Entity entity = entities.create(); // Mark as collideable (explosion particles will not be collideable). - Collideable::Handle collideable = entity.assign<Collideable>(r(8, 2)); + Collideable::Handle collideable = entity.assign<Collideable>(r(10, 5)); // "Physical" attributes. entity.assign<Body>( |