Hi
I have a small pathfinding app, when I run it with debugging it is running faster than if I compile it as release and run it. Shouldn't release be faster? What am I doing wrong? I am using Visual Studio 2017 x64.
EDIT: I am using the AppGameKit VS2017x64 template, here is a small example that runs faster when debugging and slower when running release exe.
int store_fps_array_index{ 1 };
double fps_array[4001]
{
{0.0}
}
;
long double combined_fps{ 0.0 };
float combined_fps_output{ 0.0 };
app App;
void app::Begin(void)
{
// show all errors
agk::SetErrorMode(2);
// set window properties
agk::SetWindowTitle("PATHFINDER 2");
agk::SetWindowSize(1000, 1000, 0);
agk::SetWindowAllowResize(1); // allow the user to resize the window
// set display properties
agk::SetVirtualResolution(1000, 1000); // doesn't have to match the window
agk::SetOrientationAllowed(1, 1, 1, 1); // allow both portrait and landscape on mobile devices
agk::SetSyncRate(0, 1); // 30fps instead of 60 to save battery
agk::SetScissor(0, 0, 0, 0); // use the maximum available screen space, no black borders
agk::UseNewDefaultFonts(1); // since version 2.0.22 we can use nicer default fonts
}
int app::Loop (void)
{
agk::Print( agk::ScreenFPS() );
fps_array[store_fps_array_index] = agk::ScreenFPS();
if (store_fps_array_index == 4000)
{
combined_fps = 0.0;
for (int t{ 1 }; t < 4001; t++)
{
combined_fps = combined_fps + fps_array[t];
}
combined_fps_output = combined_fps / 4000;
store_fps_array_index = 1;
}
store_fps_array_index++;
agk::Print(combined_fps_output);
agk::Sync();
return 0; // return 1 to close app
}
void app::End (void)
{
}
13/0