update main

This commit is contained in:
Irlan 2019-04-02 09:21:43 -03:00
parent cca8ccad32
commit 16421febc4

View File

@ -101,8 +101,6 @@ static void Run()
glfwGetWindowSize(g_window, &w, &h);
g_view->Event_SetWindowSize(u32(w), u32(h));
b3StackArray<ProfilerRecord*, 256> records;
while (glfwWindowShouldClose(g_window) == 0)
{
g_profiler->Begin();
@ -120,33 +118,30 @@ static void Run()
g_draw->DrawString(b3Color_white, "*PLAYING*");
}
if (g_settings->drawProfile)
{
for (u32 i = 0; i < records.Count(); ++i)
{
ProfilerRecord* r = records[i];
g_draw->DrawString(b3Color_white, "%s %.4f (min = %.4f) (max = %.4f) (calls = %d) [ms]", r->name, r->elapsed, r->minElapsed, r->maxElapsed, r->callCount);
}
}
g_view->Interface();
g_model->Update();
g_view->EndInterface();
g_profiler->EndScope();
g_profilerRecorder->BuildRecords();
if (g_settings->drawProfile)
{
records.Resize(0);
b3StackArray<ProfilerRecord*, 256> records;
g_profilerRecorder->BuildSortedRecords(records);
for (u32 i = 0; i < records.Count(); ++i)
{
ProfilerRecord* r = records[i];
g_draw->DrawString(b3Color_white, "%s %.4f (min = %.4f) (max = %.4f) (calls = %d) [ms]", r->name, r->elapsed, r->minElapsed, r->maxElapsed, r->callCount);
}
}
g_profiler->End();
g_view->EndInterface();
glfwSwapBuffers(g_window);
glfwPollEvents();
}