Skip to content

Commit

Permalink
device: add fixed timestep policy
Browse files Browse the repository at this point in the history
  • Loading branch information
dbartolini committed Oct 22, 2024
1 parent e5a89d1 commit d5f844a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/device/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ bool Device::frame()
RECORD_FLOAT("device.smoothed_dt", smoothed_dt);
RECORD_FLOAT("device.smoothed_fps", 1.0f/smoothed_dt);
dt = smoothed_dt;
} else if (_timestep_policy == TimestepPolicy::FIXED) {
// TODO
dt = raw_dt;
} else {
dt = raw_dt;
}
Expand Down
1 change: 1 addition & 0 deletions src/device/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ struct TimestepPolicy
{
VARIABLE,
SMOOTHED,
FIXED,

COUNT
};
Expand Down
1 change: 1 addition & 0 deletions src/lua/lua_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static const TimestepPolicyInfo s_timestep_policy[] =
{
{ STRING_ID_32("variable", UINT32_C(0xd638145a)), TimestepPolicy::VARIABLE },
{ STRING_ID_32("smoothed", UINT32_C(0x460246ef)), TimestepPolicy::SMOOTHED },
{ STRING_ID_32("fixed", UINT32_C(0x08eeb19e)), TimestepPolicy::FIXED }
};
CE_STATIC_ASSERT(countof(s_timestep_policy) == TimestepPolicy::COUNT);

Expand Down

0 comments on commit d5f844a

Please sign in to comment.