diff options
author | chai <chaifix@163.com> | 2018-07-31 12:19:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-31 12:19:22 +0800 |
commit | a5bb008eb554daf26f55b5fe43b0fa12ffb15973 (patch) | |
tree | 1eac93471b855ef878d3fd6a4614cfacb1ea6464 /src/libjin/core/game.cpp | |
parent | 7ac86950d3a89a996974e8406ee88e8f5f44187d (diff) |
*update
Diffstat (limited to 'src/libjin/core/game.cpp')
-rw-r--r-- | src/libjin/core/game.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libjin/core/game.cpp b/src/libjin/core/game.cpp index 929cc07..c5dd5a5 100644 --- a/src/libjin/core/game.cpp +++ b/src/libjin/core/game.cpp @@ -26,7 +26,7 @@ namespace core _running = true; Event e; int previous = getMilliSecond(); - float dt = MS_PER_UPDATE / 1000.0f; + int dt = MS_PER_UPDATE; while (_running) { while (jin::input::pollEvent(&e)) @@ -38,13 +38,13 @@ namespace core SAFECALL(_onDraw); wnd->swapBuffers(); const int current = getMilliSecond(); - dt = (current - previous) / 1000.0f; + dt = current - previous; const int wait = MS_PER_UPDATE - (current - previous); previous += MS_PER_UPDATE; if (wait > 0) { sleep(wait); - dt = MS_PER_UPDATE / 1000.0f; + dt = MS_PER_UPDATE; } else previous = current; |