Fixed some framerate issues

This commit is contained in:
Kayne Ruse
2014-04-06 20:53:51 +10:00
parent 2bacdcdab7
commit 553f8dbfa5
4 changed files with 64 additions and 8 deletions
+10
View File
@@ -133,6 +133,12 @@ void InWorld::FrameEnd() {
//
}
void InWorld::RenderFrame() {
// SDL_FillRect(GetScreen(), 0, 0);
Render(GetScreen());
SDL_Flip(GetScreen());
}
void InWorld::Render(SDL_Surface* const screen) {
//draw the map
ForNearbyRegions([&](Region* const region) {
@@ -147,6 +153,10 @@ void InWorld::Render(SDL_Surface* const screen) {
//draw UI
disconnectButton.DrawTo(screen);
shutDownButton.DrawTo(screen);
font.DrawStringTo(to_string_custom(fps.GetFrameRate()), screen, 0, 0);
fps.Calculate();
}
//-------------------------