From 3600ff8d24ea87a0b63e4931010e0dd52232246c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 2 Mar 2021 13:06:48 -0500 Subject: silence windows release build warning also remove swap busy loop again because that's still happening --- main.c | 11 +++++++---- make.bat | 6 +++--- windows_installer/ted/ted/ted.vdproj | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index b56e1fd..ec4ffc3 100644 --- a/main.c +++ b/main.c @@ -566,9 +566,7 @@ int main(int argc, char **argv) { #if DEBUG //printf("\033[H\033[2J"); #endif - #if PROFILE double frame_start = time_get_seconds(); - #endif SDL_Event event; Uint8 const *keyboard_state = SDL_GetKeyboardState(NULL); @@ -889,8 +887,8 @@ int main(int argc, char **argv) { glFinish(); - #if PROFILE double frame_end_noswap = time_get_seconds(); + #if PROFILE { print("Frame (noswap): %.1f ms\n", (frame_end_noswap - frame_start) * 1000); } @@ -901,7 +899,12 @@ int main(int argc, char **argv) { SDL_SetWindowTitle(window, ted->window_title); SDL_SetCursor(ted->cursor); - + + i32 ms_wait = (i32)((frame_end_noswap - frame_start) * 1000); + if (ms_wait > 0) { + ms_wait -= 1; // give swap an extra ms to make sure it's actually vsynced + SDL_Delay(ms_wait); + } SDL_GL_SwapWindow(window); PROFILE_TIME(frame_end); diff --git a/make.bat b/make.bat index 0a11e02..651ad52 100644 --- a/make.bat +++ b/make.bat @@ -15,6 +15,6 @@ rc /nologo ted.rc if _%1 == _ ( cl main.c stb_truetype.c ted.res /DDEBUG /DEBUG /Zi %C_FLAGS% /Fe:ted ) -if _%1 == _release cl main.c ted.res /O2 %C_FLAGS% /Fe:ted -if _%1 == _release_with_debug_info cl main.c ted.res /DEBUG /Zi /O2 %C_FLAGS% /Fe:ted -if _%1 == _profile cl main.c ted.res /O2 /DPROFILE %C_FLAGS% /Fe:ted +if _%1 == _release cl main.c ted.res /O2 /wd4702 %C_FLAGS% /Fe:ted +if _%1 == _release_with_debug_info cl main.c ted.res /DEBUG /Zi /O2 /wd4702 %C_FLAGS% /Fe:ted +if _%1 == _profile cl main.c ted.res /O2 /wd4702 /DPROFILE %C_FLAGS% /Fe:ted diff --git a/windows_installer/ted/ted/ted.vdproj b/windows_installer/ted/ted/ted.vdproj index 8f7e5cb..0991400 100644 --- a/windows_installer/ted/ted/ted.vdproj +++ b/windows_installer/ted/ted/ted.vdproj @@ -505,9 +505,9 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:ted" - "ProductCode" = "8:{14672049-6DEE-475E-B3F7-1FC69453259E}" - "PackageCode" = "8:{41413E78-89D4-42B6-9986-1B300C5AA011}" - "UpgradeCode" = "8:{3446121B-CB83-4436-A4A9-54B34F438099}" + "ProductCode" = "8:{DC9B53A1-5413-4C17-8594-40D570A7DB86}" + "PackageCode" = "8:{805B171D-F95A-4D67-8FBE-DADB06138F73}" + "UpgradeCode" = "8:{844F6C2B-DF3B-4A81-9BD5-603401BBA651}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" -- cgit v1.2.3