Skip to content

Commit

Permalink
Fix casting warnings when building in MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffM2501 committed Nov 23, 2024
1 parent 36ca9eb commit 50f5a2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -1787,12 +1787,12 @@ u32 RGFW_window_checkFPS(RGFW_window* win, u32 fpsCap) {
u64 deltaTime = RGFW_getTimeNS() - win->event.frameTime;

u32 output_fps = 0;
u64 fps = round(1e+9 / deltaTime);
u64 fps = (u64)round(1e+9 / deltaTime);
output_fps= fps;

if (fpsCap && fps > fpsCap) {
u64 frameTimeNS = 1e+9 / fpsCap;
u64 sleepTimeMS = (frameTimeNS - deltaTime) / 1e6;
u64 frameTimeNS = (u64)(1e+9 / fpsCap);
u64 sleepTimeMS = (u64)((frameTimeNS - deltaTime) / 1e6);

if (sleepTimeMS > 0) {
RGFW_sleep(sleepTimeMS);
Expand All @@ -1806,7 +1806,7 @@ u32 RGFW_window_checkFPS(RGFW_window* win, u32 fpsCap) {
return (u32) output_fps;

deltaTime = RGFW_getTimeNS() - win->event.frameTime2;
output_fps = round(1e+9 / deltaTime);
output_fps = (u64)round(1e+9 / deltaTime);
win->event.frameTime2 = RGFW_getTimeNS();

return output_fps;
Expand Down

0 comments on commit 50f5a2a

Please sign in to comment.