27 lines
481 B
C++
27 lines
481 B
C++
|
|
#include "DebugWindow.hpp"
|
||
|
|
#include <imgui.h>
|
||
|
|
#include <utility>
|
||
|
|
|
||
|
|
namespace tw::dbg {
|
||
|
|
|
||
|
|
DebugWindow::DebugWindow(std::string id, std::string title, std::string category)
|
||
|
|
: m_id(std::move(id)),
|
||
|
|
m_title(std::move(title)),
|
||
|
|
m_category(std::move(category)),
|
||
|
|
m_label(m_title + "##" + m_id)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void DebugWindow::draw() {
|
||
|
|
if(!m_open) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if(ImGui::Begin(m_label.c_str(), &m_open)) {
|
||
|
|
draw_contents();
|
||
|
|
}
|
||
|
|
ImGui::End();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|