diff options
author | tom <tom@ground-control> | 2016-05-02 15:39:22 -0500 |
---|---|---|
committer | tom <tom@ground-control> | 2016-05-02 15:39:22 -0500 |
commit | 3a2f69b3f1082b2fbdf39bd2a4f7ad0020971eac (patch) | |
tree | c5961dcb6e1ccbdf5a478d97f7383028492140d4 /src/main.cpp | |
parent | 1ddb996ac4a4fc78e5484acdadac2df95006b632 (diff) |
spring cleaning, added framerate cap & started iterator replacement
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();
|