show log in game

This commit is contained in:
Asuro
2025-03-27 17:36:55 +01:00
parent 24a724a021
commit 2ff08d7258
3 changed files with 47 additions and 2 deletions

View File

@@ -474,6 +474,22 @@ namespace Game
debug.DebugCardRotation++;
if (debug.DebugCardRotation >= 4) debug.DebugCardRotation = 0;
}
if (ImGui::Begin("Log"))
{
for (int32_t i = 0; i < bx::min(100, LogInternal::LogHistorySize); ++i)
{
int32_t idx = GetLogHistory().WriteIdx - i - 1;
if (idx < 0) idx += LogInternal::LogHistorySize;
const char* line = &GetLogHistory().LogBuffer[idx * LogInternal::MaxLineSize];
if (line[0] != 0)
{
int64_t timeOffset = GetLogHistory().WriteTime[idx] - GetInstance().Time.StartTime;
double writeTime = (double)timeOffset / bx::getHPFrequency();
ImGui::Text("%.04f: %s", writeTime, line);
}
}
}
ImGui::End();
if (ImGui::Begin("Rendering"))
{
if (LastShaderLoadTime >= 0.0f)