summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authortom <tom@ground-control>2016-05-02 15:39:22 -0500
committertom <tom@ground-control>2016-05-02 15:39:22 -0500
commit3a2f69b3f1082b2fbdf39bd2a4f7ad0020971eac (patch)
treec5961dcb6e1ccbdf5a478d97f7383028492140d4 /src/main.cpp
parent1ddb996ac4a4fc78e5484acdadac2df95006b632 (diff)
spring cleaning, added framerate cap & started iterator replacement
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
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();