Skip to content

Commit 001e780

Browse files
authored
Merge pull request #4860 from marler8997/fixDivide0
Avoid divide by 0 in core_custom_frame_control example
2 parents beaadc9 + 611c437 commit 001e780

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/core/core_custom_frame_control.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ int main(void)
9595
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
9696
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
9797
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
98-
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
98+
if (deltaTime != 0)
99+
{
100+
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
101+
}
99102

100103
EndDrawing();
101104

0 commit comments

Comments
 (0)