Fix out-of-date ReWindow API usage.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 2m0s

This commit is contained in:
2024-12-06 12:05:29 -05:00
parent 76cd48c9b7
commit a22a83d2f8

View File

@@ -131,7 +131,8 @@ public:
void display() {
float dt = 1.f / fps;
float dt = GetDeltaTime();
JGL::Update(GetSize());
if (fov_increasing)
@@ -231,6 +232,9 @@ public:
}
void OnRefresh(float elapsed) override {
fps = GetRefreshRate();
if (IsKeyDown(Keys::RightArrow))
camera->angle.y += 45.f * elapsed;
if (IsKeyDown(Keys::LeftArrow))
@@ -300,12 +304,13 @@ int main(int argc, char** argv) {
window->SetVsyncEnabled(false);
while (window->IsAlive()) {
std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
window->PollEvents();
window->Refresh();
std::chrono::high_resolution_clock::time_point stop = std::chrono::high_resolution_clock::now();
std::chrono::duration<float> frame_time = stop - start;
fps = 1.0f / frame_time.count();
window->ManagedRefresh();
//std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();
//window->PollEvents();
//window->Refresh();
//std::chrono::high_resolution_clock::time_point stop = std::chrono::high_resolution_clock::now();
//std::chrono::duration<float> frame_time = stop - start;
//fps = 1.0f / frame_time.count();
}
return 0;
}