Implemented a simpler frame rate system
This commit is contained in:
+6
-1
@@ -34,6 +34,7 @@ InWorld::InWorld() {
|
||||
cout << "entering InWorld" << endl;
|
||||
#endif
|
||||
cout << "Client Index: " << infoMgr->GetClientIndex() << endl;
|
||||
font.SetSurface(surfaceMgr->Get("font"));
|
||||
}
|
||||
|
||||
InWorld::~InWorld() {
|
||||
@@ -59,7 +60,11 @@ void InWorld::FrameEnd() {
|
||||
}
|
||||
|
||||
void InWorld::Render(SDL_Surface* const screen) {
|
||||
//
|
||||
ClockFrameRate();
|
||||
|
||||
//since we're using this twice, make a tmp var
|
||||
string fps = itos(GetFrameRate());
|
||||
font.DrawStringTo(fps, screen, screen->w - fps.size() * font.GetCharW(), 0);
|
||||
}
|
||||
|
||||
//-------------------------
|
||||
|
||||
+2
-1
@@ -35,6 +35,7 @@
|
||||
#include "udp_network_utility.hpp"
|
||||
#include "button.hpp"
|
||||
#include "raster_font.hpp"
|
||||
#include "frame_rate.hpp"
|
||||
|
||||
class InWorld : public BaseScene {
|
||||
public:
|
||||
@@ -70,7 +71,7 @@ protected:
|
||||
InformationManager* infoMgr = ServiceLocator<InformationManager>::Get();
|
||||
|
||||
//members
|
||||
//...
|
||||
RasterFont font;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user