Fixed imgui and debug display renderer (nothing was actually broken but request were never flushed ... )
This commit is contained in:
@@ -70,14 +70,11 @@ namespace Juliet
|
||||
std::string timestamp = std::format("[{:%F %T}] ", entry.Time);
|
||||
std::string fullMessage = timestamp + CStr(entry.Value) + "\n";
|
||||
|
||||
if ((kPrintDebugLog && entry.Level == LogLevel::Debug) || entry.Level >= LogLevel::Message)
|
||||
{
|
||||
#ifdef JULIET_WIN32
|
||||
OutputDebugStringA(fullMessage.c_str());
|
||||
#endif
|
||||
printf("%s", fullMessage.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (level == LogLevel::Debug && kPrintDebugLog == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO : Revisit, copy from https://github.com/Eclmist/Ether/blob/develop/src/common/logging/loggingmanager.cpp
|
||||
char formattedBuffer[4096];
|
||||
|
||||
|
||||
@@ -42,15 +42,15 @@ namespace Juliet
|
||||
#ifdef JULIET_ENABLE_IMGUI
|
||||
if (NonNullPtr window = EngineInstance.Application->GetPlatformWindow())
|
||||
{
|
||||
// ImGuiService::Initialize(window);
|
||||
// ImGui::SetCurrentContext(ImGuiService::GetContext());
|
||||
ImGuiService::Initialize(window);
|
||||
ImGui::SetCurrentContext(ImGuiService::GetContext());
|
||||
|
||||
if (device)
|
||||
{
|
||||
// ImGuiRenderer_Initialize(device);
|
||||
ImGuiRenderer_Initialize(device);
|
||||
|
||||
// Run Unit Tests automatically
|
||||
// ImGuiService::RunTests();
|
||||
ImGuiService::RunTests();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -64,9 +64,9 @@ namespace Juliet
|
||||
#ifdef JULIET_ENABLE_IMGUI
|
||||
if (device)
|
||||
{
|
||||
// ImGuiRenderer_Shutdown(device);
|
||||
ImGuiRenderer_Shutdown(device);
|
||||
}
|
||||
// ImGuiService::Shutdown();
|
||||
ImGuiService::Shutdown();
|
||||
#endif
|
||||
|
||||
// DebugDisplay system
|
||||
@@ -107,7 +107,7 @@ namespace Juliet
|
||||
EngineInstance.Application->OnPreRender(cmdList);
|
||||
|
||||
// Prepare debug display data (before render pass)
|
||||
// DebugDisplay_Prepare(cmdList);
|
||||
DebugDisplay_Prepare(cmdList);
|
||||
|
||||
// Get render targets from application
|
||||
ColorTargetInfo colorInfo = EngineInstance.Application->GetColorTargetInfo(swapChainTexture);
|
||||
@@ -119,12 +119,12 @@ namespace Juliet
|
||||
EngineInstance.Application->OnRender(pass, cmdList);
|
||||
|
||||
// Debug display flush (inside render pass)
|
||||
// Camera debugCamera = EngineInstance.Application->GetDebugCamera();
|
||||
// DebugDisplay_Flush(cmdList, pass, debugCamera);
|
||||
Camera debugCamera = EngineInstance.Application->GetDebugCamera();
|
||||
DebugDisplay_Flush(cmdList, pass, debugCamera);
|
||||
|
||||
#ifdef JULIET_ENABLE_IMGUI
|
||||
// ImGui rendering (always last before EndRenderPass)
|
||||
// ImGuiRenderer_Render(cmdList, pass);
|
||||
ImGuiRenderer_Render(cmdList, pass);
|
||||
#endif
|
||||
|
||||
EndRenderPass(pass);
|
||||
@@ -178,7 +178,7 @@ namespace Juliet
|
||||
while (EngineInstance.Application->IsRunning())
|
||||
{
|
||||
#ifdef JULIET_ENABLE_IMGUI
|
||||
// ImGuiRenderer_NewFrame();
|
||||
ImGuiRenderer_NewFrame();
|
||||
#endif
|
||||
|
||||
// Logic tick
|
||||
|
||||
Reference in New Issue
Block a user