Change precedence of casts

This commit is contained in:
Krzosa Karol
2022-06-18 09:21:33 +02:00
parent 012d7fb6ad
commit f876b69779
4 changed files with 11 additions and 5 deletions

View File

@@ -50,6 +50,12 @@ window_procedure :: (hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM): LRE
else;; return DefWindowProcW(hwnd, msg, wparam, lparam)
_gcvt :: #foreign (value: F64, digits: int, buffer: *char): *char
print_float :: (value: F64)
buff: [100]char
_gcvt(value, 10, &buff[0])
OutputDebugStringA("\n")
OutputDebugStringA(&buff[0])
WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nShowCmd: int): int
if good_scheduling := false, timeBeginPeriod(1) == TIMERR_NOERROR
good_scheduling = true
@@ -99,9 +105,7 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
frame_time := time() - frame_start_time
_gcvt(frame_time, 10, buff)
OutputDebugStringA("\n")
OutputDebugStringA(buff)
print_float(frame_time)
if frame_time < requested_time_per_frame
if good_scheduling
time_to_sleep := (requested_time_per_frame - frame_time) * 1000