Fixed imgui and debug display renderer (nothing was actually broken but request were never flushed ... )

This commit is contained in:
2026-02-21 18:35:39 -05:00
parent bbd1095227
commit 2362cefbc0
2 changed files with 18 additions and 16 deletions

View File

@@ -70,14 +70,11 @@ namespace Juliet
std::string timestamp = std::format("[{:%F %T}] ", entry.Time); std::string timestamp = std::format("[{:%F %T}] ", entry.Time);
std::string fullMessage = timestamp + CStr(entry.Value) + "\n"; std::string fullMessage = timestamp + CStr(entry.Value) + "\n";
if ((kPrintDebugLog && entry.Level == LogLevel::Debug) || entry.Level >= LogLevel::Message)
{
#ifdef JULIET_WIN32 #ifdef JULIET_WIN32
OutputDebugStringA(fullMessage.c_str()); OutputDebugStringA(fullMessage.c_str());
#endif #endif
printf("%s", fullMessage.c_str()); printf("%s", fullMessage.c_str());
} }
}
void PushLogEntry(NonNullPtr<Logs> logs, String value, LogLevel level, LogCategory category) void PushLogEntry(NonNullPtr<Logs> logs, String value, LogLevel level, LogCategory category)
{ {
@@ -139,6 +136,11 @@ namespace Juliet
void Log(LogLevel level, LogCategory category, const char* fmt, va_list args) void Log(LogLevel level, LogCategory category, const char* fmt, va_list args)
{ {
if (level == LogLevel::Debug && kPrintDebugLog == false)
{
return;
}
// TODO : Revisit, copy from https://github.com/Eclmist/Ether/blob/develop/src/common/logging/loggingmanager.cpp // TODO : Revisit, copy from https://github.com/Eclmist/Ether/blob/develop/src/common/logging/loggingmanager.cpp
char formattedBuffer[4096]; char formattedBuffer[4096];

View File

@@ -42,15 +42,15 @@ namespace Juliet
#ifdef JULIET_ENABLE_IMGUI #ifdef JULIET_ENABLE_IMGUI
if (NonNullPtr window = EngineInstance.Application->GetPlatformWindow()) if (NonNullPtr window = EngineInstance.Application->GetPlatformWindow())
{ {
// ImGuiService::Initialize(window); ImGuiService::Initialize(window);
// ImGui::SetCurrentContext(ImGuiService::GetContext()); ImGui::SetCurrentContext(ImGuiService::GetContext());
if (device) if (device)
{ {
// ImGuiRenderer_Initialize(device); ImGuiRenderer_Initialize(device);
// Run Unit Tests automatically // Run Unit Tests automatically
// ImGuiService::RunTests(); ImGuiService::RunTests();
} }
} }
#endif #endif
@@ -64,9 +64,9 @@ namespace Juliet
#ifdef JULIET_ENABLE_IMGUI #ifdef JULIET_ENABLE_IMGUI
if (device) if (device)
{ {
// ImGuiRenderer_Shutdown(device); ImGuiRenderer_Shutdown(device);
} }
// ImGuiService::Shutdown(); ImGuiService::Shutdown();
#endif #endif
// DebugDisplay system // DebugDisplay system
@@ -107,7 +107,7 @@ namespace Juliet
EngineInstance.Application->OnPreRender(cmdList); EngineInstance.Application->OnPreRender(cmdList);
// Prepare debug display data (before render pass) // Prepare debug display data (before render pass)
// DebugDisplay_Prepare(cmdList); DebugDisplay_Prepare(cmdList);
// Get render targets from application // Get render targets from application
ColorTargetInfo colorInfo = EngineInstance.Application->GetColorTargetInfo(swapChainTexture); ColorTargetInfo colorInfo = EngineInstance.Application->GetColorTargetInfo(swapChainTexture);
@@ -119,12 +119,12 @@ namespace Juliet
EngineInstance.Application->OnRender(pass, cmdList); EngineInstance.Application->OnRender(pass, cmdList);
// Debug display flush (inside render pass) // Debug display flush (inside render pass)
// Camera debugCamera = EngineInstance.Application->GetDebugCamera(); Camera debugCamera = EngineInstance.Application->GetDebugCamera();
// DebugDisplay_Flush(cmdList, pass, debugCamera); DebugDisplay_Flush(cmdList, pass, debugCamera);
#ifdef JULIET_ENABLE_IMGUI #ifdef JULIET_ENABLE_IMGUI
// ImGui rendering (always last before EndRenderPass) // ImGui rendering (always last before EndRenderPass)
// ImGuiRenderer_Render(cmdList, pass); ImGuiRenderer_Render(cmdList, pass);
#endif #endif
EndRenderPass(pass); EndRenderPass(pass);
@@ -178,7 +178,7 @@ namespace Juliet
while (EngineInstance.Application->IsRunning()) while (EngineInstance.Application->IsRunning())
{ {
#ifdef JULIET_ENABLE_IMGUI #ifdef JULIET_ENABLE_IMGUI
// ImGuiRenderer_NewFrame(); ImGuiRenderer_NewFrame();
#endif #endif
// Logic tick // Logic tick