1
Window / Very simply!
« on: January 23, 2012, 11:48:19 pm »
(Um... I posted the full program code in my first post, above...! That's all there is to it. It's basically the SFML 1.6 tutorial almost verbatim; actually even simpler, just one side of the cube instead of all six sides, and only one rotation instead of three. Feel free to copy-paste into a fresh main.cpp and try it at home.)
But specifically, on each frame I am rotating the square by an angle of SOME_CONSTANT * sf::Clock::GetElapsedTime().AsSeconds().
I am not "accumulating" the rotation angles (summation).
I am not using fps, or frame-to-frame intervals.
I am just using "current time" -- of course, if sf::Window::Display() calls sleep() before rendering the frame, that might explain this behavior. Then the timestamp that I am using might not correspond very well to the time that the image ends up drawn on screen.
Otherwise, the orientation of the square should be independent of fps, and strictly a function of wall-clock time (OK ok, plus some uncontrollable little delay between the sf::Clock::GetElapsedTime() and the time the image ends up on the monitor, and the time that it takes for the light to travel to my eyes and for my brain to register it & process it).
But specifically, on each frame I am rotating the square by an angle of SOME_CONSTANT * sf::Clock::GetElapsedTime().AsSeconds().
I am not "accumulating" the rotation angles (summation).
I am not using fps, or frame-to-frame intervals.
I am just using "current time" -- of course, if sf::Window::Display() calls sleep() before rendering the frame, that might explain this behavior. Then the timestamp that I am using might not correspond very well to the time that the image ends up drawn on screen.
Otherwise, the orientation of the square should be independent of fps, and strictly a function of wall-clock time (OK ok, plus some uncontrollable little delay between the sf::Clock::GetElapsedTime() and the time the image ends up on the monitor, and the time that it takes for the light to travel to my eyes and for my brain to register it & process it).