diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index ed41895..25d4cc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,8 +6,12 @@ int main() List L(main);
Event e;
+ Timer fps;
+
while(e.gRun())
{
+ fps.Start();
+
while(e.Poll())
{
if(e.gEventType() == SDL_QUIT)
@@ -22,7 +26,9 @@ int main() L.Behavior();
main.Render();
- //SDL_Delay(10);
+
+ if(fps.getTicks() < (1000 / 60))
+ SDL_Delay((1000 / 60) - fps.getTicks());
}
main.Destroy();
|