Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Nov 12, 2023
1 parent f0f7206 commit 3d461ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Sources/nCine/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ namespace nCine
#if defined(DEATH_TARGET_WINDOWS)
const std::uint64_t clockFreq = static_cast<std::uint64_t>(clock().frequency());
const std::uint64_t frameTimeDuration = (clockFreq / static_cast<std::uint64_t>(appCfg_.frameLimit));
const std::int64_t remainingTime = (std::int64_t)frameTimeDuration - (std::int64_t)frameTimer_->frameIntervalAsTicks();
const std::int64_t remainingTime = (std::int64_t)frameTimeDuration - (std::int64_t)frameTimer_->frameDurationAsTicks();
if (remainingTime > 0) {
LARGE_INTEGER dueTime;
dueTime.QuadPart = -(LONGLONG)((10000000ULL * remainingTime) / clockFreq);
Expand All @@ -691,8 +691,8 @@ namespace nCine
::CancelWaitableTimer(_waitableTimer);
}
#else
const float frameTimeDuration = 1.0f / static_cast<float>(appCfg_.frameLimit);
while (frameTimer_->frameInterval() < frameTimeDuration) {
const float frameDuration = 1.0f / static_cast<float>(appCfg_.frameLimit);
while (frameTimer_->frameDuration() < frameDuration) {
Timer::sleep(0);
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions Sources/nCine/Base/FrameTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ namespace nCine
inline unsigned long int totalNumberFrames() const {
return totNumFrames_;
}
/// Returns the interval in seconds between the last two subsequent calls to `addFrame()`
/// Returns the last frame duration in seconds between the last two subsequent calls to `addFrame()`
inline float lastFrameDuration() const {
return frameDuration_;
}
/// Returns the interval in seconds since the last call to `addFrame()`
inline float currentFrameDuration() const {
/// Returns current frame duration in seconds since the last call to `addFrame()`
inline float frameDuration() const {
return frameStart_.secondsSince();
}
/// Returns the interval in ticks since the last call to `addFrame()`
inline uint64_t frameIntervalAsTicks() const {
/// Returns current frame duration in ticks since the last call to `addFrame()`
inline uint64_t frameDurationAsTicks() const {
return frameStart_.timeSince().ticks();
}
/// Returns the average FPS during the update interval
Expand Down

0 comments on commit 3d461ab

Please sign in to comment.