diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:18 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-20 12:40:18 (GMT) |
| commit | 2be9c925088c16beb144dd9932202416d00ff581 (patch) | |
| tree | 51f8ccbf2b0b051890c5f5d12fa28a67635c06c2 /src/PowderToySDL.cpp | |
| parent | 9769239af69695e9a7f8cf103a197695ecf691e0 (diff) | |
| download | powder-2be9c925088c16beb144dd9932202416d00ff581.zip powder-2be9c925088c16beb144dd9932202416d00ff581.tar.gz | |
OpenGL canvas for Windows, Notifications for main Game, Update checker in Client (+ other client triggered events)
Diffstat (limited to 'src/PowderToySDL.cpp')
| -rw-r--r-- | src/PowderToySDL.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 0229103..d268f57 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -129,6 +129,7 @@ return surface; int main(int argc, char * argv[]) { int elapsedTime = 0, currentTime = 0, lastTime = 0, currentFrame = 0; + unsigned int lastTick = 0; float fps = 0, delta = 1.0f; sdl_scrn = SDLOpen(); @@ -192,6 +193,13 @@ int main(int argc, char * argv[]) engine->Tick(); engine->Draw(); + if(SDL_GetTicks()-lastTick>1000) + { + //Run client tick every second + lastTick = SDL_GetTicks(); + Client::Ref().Tick(); + } + #ifdef OGLR blit(); #else |
