You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
534 B
C++
27 lines
534 B
C++
#ifndef LOGVIEW_H
|
|
#define LOGVIEW_H
|
|
|
|
#include <string>
|
|
|
|
#include "imgui.h"
|
|
|
|
// Adapted from ExampleAppLog from imgui_demo.cpp
|
|
class LogView
|
|
{
|
|
public:
|
|
LogView();
|
|
|
|
void Clear();
|
|
void AddLog(const std::string& str);
|
|
void AddLog(const char* fmt, ...) IM_FMTARGS(2);
|
|
void Draw(const char* title, bool* p_open = NULL, ImGuiWindowFlags flags = 0);
|
|
|
|
private:
|
|
ImGuiTextBuffer Buf;
|
|
ImVector<int> LineOffsets; // Index to lines offset. We maintain this with AddLog() calls.
|
|
bool updated;
|
|
};
|
|
|
|
#endif // LOGVIEW_H
|
|
|