|
|
|
@ -45,7 +45,7 @@ namespace lunarium
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
LogGui* LogGui::mpInstance = nullptr;
|
|
|
|
LogGui* LogGui::mpInstance = nullptr;
|
|
|
|
LogGui::LogGui()
|
|
|
|
LogGui::LogGui()
|
|
|
|
: mbShow(false), mListener(this), mbOglDebug(false), mbInfoVerbose(false)
|
|
|
|
: mbShow(false), mbStickToWindow(true), mListener(this), mbOglDebug(false), mbInfoVerbose(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -83,17 +83,30 @@ namespace lunarium
|
|
|
|
Core::MainWindow().GetPosition(&x, &y);
|
|
|
|
Core::MainWindow().GetPosition(&x, &y);
|
|
|
|
int width, height;
|
|
|
|
int width, height;
|
|
|
|
Core::MainWindow().GetFramebufferSize(&width, &height);
|
|
|
|
Core::MainWindow().GetFramebufferSize(&width, &height);
|
|
|
|
|
|
|
|
|
|
|
|
int logHeight = height / 2.0f;
|
|
|
|
int logHeight = height / 2.0f;
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(x, y + logHeight), ImGuiCond_Always);
|
|
|
|
if (mbStickToWindow)
|
|
|
|
ImGui::SetNextWindowSize(ImVec2((width / 3.0f) * 2.0f, logHeight), ImGuiCond_Always);
|
|
|
|
|
|
|
|
if (!ImGui::Begin("Debug Log", &mbShow, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove
|
|
|
|
|
|
|
|
| ImGuiWindowFlags_NoSavedSettings))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImGui::End();
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(x, y + logHeight), ImGuiCond_Always);
|
|
|
|
return;
|
|
|
|
ImGui::SetNextWindowSize(ImVec2((width / 3.0f) * 2.0f, logHeight), ImGuiCond_Always);
|
|
|
|
|
|
|
|
if (!ImGui::Begin("Debug Log", &mbShow, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove
|
|
|
|
|
|
|
|
| ImGuiWindowFlags_NoSavedSettings))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(x, y + logHeight), ImGuiCond_FirstUseEver);
|
|
|
|
|
|
|
|
ImGui::SetNextWindowSize(ImVec2((width / 3.0f) * 2.0f, logHeight), ImGuiCond_FirstUseEver);
|
|
|
|
|
|
|
|
if (!ImGui::Begin("Debug Log", &mbShow))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::BeginChild("Message Types", ImVec2(0.0f, 20.0f));
|
|
|
|
ImGui::BeginChild("Message Types", ImVec2(0.0f, 20.0f));
|
|
|
|
ImGui::Checkbox("OGL_DEBUG", &mbOglDebug);
|
|
|
|
ImGui::Checkbox("OGL_DEBUG", &mbOglDebug);
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::SameLine();
|
|
|
|
@ -152,4 +165,14 @@ namespace lunarium
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return mbShow;
|
|
|
|
return mbShow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool LogGui::IsStuckToWindow() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return mbStickToWindow;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LogGui::SetStickToWindow(bool stick)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mbStickToWindow = stick;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|