Closed IslandUsurper closed 9 years ago
You use it just under current_view.resume(&mut context)
. A few lines down, there is the bigger picture (in Abstracting the game loop).
I modified slightly the snippet to make it more obvious.
What really threw me is that there wasn't any mention of use ::sdl2::timer;
in any of your code snippets. I don't mind that it wasn't said to add it in explicitly, but none of your code samples included that line either, so I didn't know if it was part of std
or where in the sdl2
crate it existed either. I had to go look at their repository to find it.
Thanks, I didn't notice that. It is now fixed. Hopefully, it should be less confusing! :-)
While I noticed the call to
timer()
when building thesdl_context
, I can't figure out how to actually use the frame timing code. I guessed that it was added to src/main.rs, but that isn't completely obvious, either.What do I declare to make the third code example work?