-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89ceb5a
commit 1a00426
Showing
3 changed files
with
15 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
#include <cubos/engine/fixedstep/plugin.hpp> | ||
#include <cubos/engine/fixedstep/accumulated_time.hpp> | ||
|
||
#include <cubos/engine/fixedstep/plugin.hpp> | ||
|
||
using namespace cubos::engine; | ||
|
||
const float frametime = 1/60; | ||
|
||
|
||
const float frametime = 0.01F; | ||
|
||
void cubos::engine::fixedStepPlugin(Cubos& cubos) | ||
{ | ||
cubos.addResource<AccumulatedTime>(); | ||
|
||
cubos.system("accumulate time resource").call([](AccumulatedTime& timer, const DeltaTime& dt) { | ||
timer.value += dt.value; | ||
}); | ||
cubos.system("accumulate time resource") | ||
.tagged("accumulator") | ||
.call([](AccumulatedTime& timer, const DeltaTime& dt) { timer.value += dt.value; }); | ||
|
||
cubos.tag("cubos.fixedStep").repeatWhile([](AccumulatedTime& timer) { | ||
if (timer.value >= frametime) { | ||
timer.value -= frametime; | ||
return true; | ||
} | ||
return false; | ||
}); | ||
if (timer.value >= frametime) | ||
{ | ||
timer.value -= frametime; | ||
return true; | ||
} | ||
return false; | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters