Limit refresh rate to 60hz when not using variableDt

Fixes #334
This commit is contained in:
Luke Street 2020-09-15 17:29:09 -04:00
parent 169bc66d40
commit d3a4a221f5
2 changed files with 9 additions and 4 deletions

View File

@ -99,8 +99,6 @@ struct Application : boo::IApplicationCallback {
}
}
m_cvarManager.parseCommandLine(app->getArgs());
const zeus::CPUInfo& cpuInf = zeus::cpuFeatures();
Log.report(logvisor::Info, FMT_STRING("CPU Name: {}"), cpuInf.cpuBrand);
Log.report(logvisor::Info, FMT_STRING("CPU Vendor: {}"), cpuInf.cpuVendor);
@ -114,6 +112,8 @@ struct Application : boo::IApplicationCallback {
uint32_t getAnisotropy() const { return m_cvarCommons.getAnisotropy(); }
bool getDeepColor() const { return m_cvarCommons.getDeepColor(); }
int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; }
};
} // namespace urde
@ -165,6 +165,11 @@ int main(int argc, const boo::SystemChar** argv)
hecl::CVarManager cvarMgr{fileMgr};
hecl::CVarCommons cvarCmns{cvarMgr};
std::vector<boo::SystemString> args;
for (int i = 1; i < argc; ++i)
args.push_back(argv[i]);
cvarMgr.parseCommandLine(args);
hecl::SystemStringView logFile = hecl::SystemStringConv(cvarCmns.getLogFile()).sys_str();
hecl::SystemString logFilePath;
if (!logFile.empty()) {
@ -191,7 +196,7 @@ int main(int argc, const boo::SystemChar** argv)
urde::Application appCb(fileMgr, cvarMgr, cvarCmns);
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("urde"), _SYS_STR("URDE"), argc,
argv, appCb.getGraphicsApi(), appCb.getSamples(), appCb.getAnisotropy(),
appCb.getDeepColor(), false);
appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
// printf("IM DYING!!\n");
return ret;
}

2
hecl

@ -1 +1 @@
Subproject commit d0192a1623f0114fc93de10737a6c1d5f89c4e22
Subproject commit 1dd9c3477244f2e68ecdb9330179a34d867038d3