codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <SFML/Graphics.hpp> #include <sstream> using namespace sf; using namespace std; int main() { RenderWindow app(VideoMode(800, 600, 32), "SFML Test"); app.setVerticalSyncEnabled(true); app.create(VideoMode(800, 600, 32), "SFML Test"); Clock myClock; float fps = 1 / myClock.restart().asSeconds(); stringstream ssFPS; ssFPS << "fps: " << fps; Text myText(ssFPS.str()); while (app.isOpen()){ Event evento; while (app.pollEvent(evento)){ if (evento.type == Event::Closed){ app.close(); } } fps = 1 / myClock.restart().asSeconds(); stringstream ssFPS; ssFPS << "fps: " << fps; Text myText(ssFPS.str()); app.clear(); app.draw(myText); app.display(); } return 0; }
Private
[
?
]
Run code
Submit