Skip to content

Commit

Permalink
FPS logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweees committed Oct 18, 2024
1 parent 06434de commit b0116a0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,9 @@ Display::~Display() {
}

void Display::update() {
int currentTime = SDL_GetTicks();
int deltaTime = currentTime - prevTime;
prevTime = currentTime;
while (!SDL_TICKS_PASSED(SDL_GetTicks(), prevTime + FRAME_TIME));
prevTime = SDL_GetTicks();

if (true) {
#ifdef USE_CUDA
LaunchCuda();
#elif USE_METAL
Expand Down Expand Up @@ -163,8 +161,6 @@ void Display::update() {
break;
}
rotation.translate(rotationSpeed.x, rotationSpeed.y, rotationSpeed.z);
deltaTime = 0;
}
}

void Display::render() {
Expand Down

0 comments on commit b0116a0

Please sign in to comment.